Update build:docs and trans:docs scripts

This commit is contained in:
Harvey Zack committed 2023-11-26 13:23:21 +08:00
1 parent a2d3e20479
commit a2b57495a2
20 files changed
+749 -775

No files matched your search

@@ -1,8 +1,8 @@
# 设置面板
# Settings Panel
## 内置
## Built-in
须先打开设置面板,然后自带四个内置项:`flip`, `playbackRate`, `aspectRatio`, `subtitleOffset`
First, open the settings panel, and then it comes with four built-in items: `flip`, `playbackRate`, `aspectRatio`, `subtitleOffset`
<div className="run-code">▶ Run Code</div>
@@ -10,7 +10,7 @@
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
setting: true,
setting: true,
flip: true,
playbackRate: true,
aspectRatio: true,
@@ -18,12 +18,12 @@ var art = new Artplayer({
});
```
## Create - Selection List
## 创建 - 选择列表
| Property | Type | Description |
| ---------- | ------------------- | ------------ |
| `html` | `String`, `Element` | Element's DOM |
| 属性 | 类型 | 描述 |
| ---------- | ------------------- | ------------ |
| `html` | `String`, `Element` | 元素的 DOM |
| `icon` | `String`, `Element` | 元素的图标 |
| `selector` | `Array` | 元素列表 |
| `onSelect` | `Function` | 元素点击事件 |
@@ -88,7 +88,7 @@ var art = new Artplayer({
});
```
## 创建 - 列表嵌套
## Creating - Nested Lists
<div className="run-code">▶ Run Code</div>
@@ -138,16 +138,15 @@ var art = new Artplayer({
],
});
```
## Create - Toggle Button
## 创建 - 切换按钮
| 属性 | 类型 | 描述 |
| ---------- | ------------------- | --------------- |
| `html` | `String`, `Element` | 元素的 DOM 元素 |
| `icon` | `String`, `Element` | 元素的图标 |
| `switch` | `Boolean` | 按钮默认状态 |
| `onSwitch` | `Function` | 按钮切换事件 |
| `tooltip` | `String` | 提示文本 |
| Property | Type | Description |
| ---------- | ------------------- | ----------------- |
| `html` | `String`, `Element` | Element's DOM element |
| `icon` | `String`, `Element` | Element's icon |
| `switch` | `Boolean` | Button's default state |
| `onSwitch` | `Function` | Button toggle event |
| `tooltip` | `String` | Tooltip text |
<div className="run-code">▶ Run Code</div>
@@ -173,17 +172,16 @@ var art = new Artplayer({
],
});
```
## Create - Range Slider
## 创建 - 范围滑块
| 属性 | 类型 | 描述 |
| ---------- | ------------------- | ---------------- |
| `html` | `String`, `Element` | 元素的 DOM 元素 |
| `icon` | `String`, `Element` | 元素的图标 |
| `range` | `Array` | 默认状态数组 |
| `onRange` | `Function` | 完成时触发的事件 |
| `onChange` | `Function` | 变化时触发的事件 |
| `tooltip` | `String` | 提示文本 |
| Attribute | Type | Description |
| ---------- | ------------------- | --------------------------- |
| `html` | `String`, `Element` | The element's DOM element |
| `icon` | `String`, `Element` | The element's icon |
| `range` | `Array` | Default state array |
| `onRange` | `Function` | Event triggered upon completion |
| `onChange` | `Function` | Event triggered on change |
| `tooltip` | `String` | Tooltip text |
```js
const range = [5, 1, 10, 1];
@@ -192,7 +190,6 @@ const min = range[1];
const max = range[2];
const step = range[3];
```
<div className="run-code">▶ Run Code</div>
```js
@@ -204,7 +201,7 @@ var art = new Artplayer({
{
html: 'Slider',
tooltip: '5x',
icon: '<img width="22" heigth="22" src="/assets/img/state.svg">',
icon: '<img width="22" height="22" src="/assets/img/state.svg">',
range: [5, 1, 10, 1],
onChange: function (item, $dom, event) {
console.info(item, $dom, event);
@@ -214,8 +211,7 @@ var art = new Artplayer({
],
});
```
## 添加
## Add
<div className="run-code">▶ Run Code</div>
@@ -236,7 +232,7 @@ art.setting.add({
});
```
## 删除
## Delete
<div className="run-code">▶ Run Code</div>
@@ -266,8 +262,7 @@ art.on('ready', () => {
}, 3000);
});
```
## 更新
## Updates
<div className="run-code">▶ Run Code</div>