mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
Update build:docs and trans:docs scripts
This commit is contained in:
1 parent
a2d3e20479
commit
a2b57495a2
20 files changed
+749
-775
No files matched your search
@@ -1,19 +1,19 @@
|
||||
# 业务层
|
||||
# Layer
|
||||
|
||||
## 配置
|
||||
## Configuration
|
||||
|
||||
| 属性 | 类型 | 描述 |
|
||||
| --------- | ------------------- | -------------------------- |
|
||||
| `disable` | `Boolean` | 是否禁用组件 |
|
||||
| `name` | `String` | 组件唯一名称,用于标记类名 |
|
||||
| `index` | `Number` | 组件索引,用于显示的优先级 |
|
||||
| `html` | `String`, `Element` | 组件的 DOM 元素 |
|
||||
| `style` | `Object` | 组件样式对象 |
|
||||
| `click` | `Function` | 组件点击事件 |
|
||||
| `mounted` | `Function` | 组件挂载后触发 |
|
||||
| `tooltip` | `String` | 组件的提示文本 |
|
||||
| Property | Type | Description |
|
||||
| --------- | --------------------- | ---------------------------- |
|
||||
| `disable` | `Boolean` | Whether to disable the component |
|
||||
| `name` | `String` | Unique name of the component, used for marking class name |
|
||||
| `index` | `Number` | Component index, used for display priority |
|
||||
| `html` | `String`, `Element` | The DOM element of the component |
|
||||
| `style` | `Object` | Style object for the component |
|
||||
| `click` | `Function` | Click event for the component |
|
||||
| `mounted` | `Function` | Triggered after the component is mounted |
|
||||
| `tooltip` | `String` | Tooltip text for the component |
|
||||
|
||||
## 创建
|
||||
## Creation
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -24,9 +24,9 @@ var art = new Artplayer({
|
||||
url: '/assets/sample/video.mp4',
|
||||
layers: [
|
||||
{
|
||||
name: 'potser',
|
||||
name: 'poster',
|
||||
html: `<img style="width: 100px" src="${img}">`,
|
||||
tooltip: 'Potser Tip',
|
||||
tooltip: 'Poster Tip',
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: '50px',
|
||||
@@ -43,10 +43,9 @@ var art = new Artplayer({
|
||||
});
|
||||
|
||||
// Get the Element of layer by name
|
||||
console.info(art.layers['potser']);
|
||||
console.info(art.layers['poster']);
|
||||
```
|
||||
|
||||
## 添加
|
||||
## Add
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -58,9 +57,9 @@ var art = new Artplayer({
|
||||
});
|
||||
|
||||
art.layers.add({
|
||||
name: 'potser',
|
||||
name: 'poster',
|
||||
html: `<img style="width: 100px" src="${img}">`,
|
||||
tooltip: 'Potser Tip',
|
||||
tooltip: 'Poster Tip',
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: '50px',
|
||||
@@ -75,10 +74,9 @@ art.layers.add({
|
||||
});
|
||||
|
||||
// Get the Element of layer by name
|
||||
console.info(art.layers['potser']);
|
||||
console.info(art.layers['poster']);
|
||||
```
|
||||
|
||||
## 删除
|
||||
## Delete
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -89,7 +87,7 @@ var art = new Artplayer({
|
||||
url: '/assets/sample/video.mp4',
|
||||
layers: [
|
||||
{
|
||||
name: 'potser',
|
||||
name: 'poster',
|
||||
html: `<img style="width: 100px" src="${img}">`,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
@@ -103,12 +101,11 @@ var art = new Artplayer({
|
||||
art.on('ready', () => {
|
||||
setTimeout(() => {
|
||||
// Delete the layer by name
|
||||
art.layers.remove('potser');
|
||||
art.layers.remove('poster');
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
|
||||
## 更新
|
||||
## Update
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -119,7 +116,7 @@ var art = new Artplayer({
|
||||
url: '/assets/sample/video.mp4',
|
||||
layers: [
|
||||
{
|
||||
name: 'potser',
|
||||
name: 'poster',
|
||||
html: `<img style="width: 100px" src="${img}">`,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
@@ -134,7 +131,7 @@ art.on('ready', () => {
|
||||
setTimeout(() => {
|
||||
// Update the layer by name
|
||||
art.layers.update({
|
||||
name: 'potser',
|
||||
name: 'poster',
|
||||
html: `<img style="width: 200px" src="${img}">`,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
|
||||
Reference in new issue
Block a user