@video-lab/embed-helper 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,11 +10,11 @@ Video Lab Player 的静态 iframe 宿主侧事件监听器。
|
|
|
10
10
|
|
|
11
11
|
### 1. `<script>` 标签(无构建工具)
|
|
12
12
|
|
|
13
|
-
`helper.js` 和 iframe
|
|
13
|
+
`helper.js` 和 iframe 地址位于同一部署根目录。以下的 `player.example.com` 仅为占位符,实际地址由内部部署配置提供:
|
|
14
14
|
|
|
15
15
|
```html
|
|
16
16
|
<iframe id="article-player"></iframe>
|
|
17
|
-
<script src="https://player.example.com/
|
|
17
|
+
<script src="https://player.example.com/helper.js"></script>
|
|
18
18
|
<script>
|
|
19
19
|
const iframe = document.getElementById('article-player')
|
|
20
20
|
if (!(iframe instanceof HTMLIFrameElement)) throw new Error('iframe 未找到')
|
|
@@ -24,7 +24,7 @@ Video Lab Player 的静态 iframe 宿主侧事件监听器。
|
|
|
24
24
|
})
|
|
25
25
|
player.on('ended', () => { location.href = nextUrl })
|
|
26
26
|
// 订阅完成后再开始加载,静态事件不回放。
|
|
27
|
-
iframe.src = 'https://player.example.com
|
|
27
|
+
iframe.src = 'https://player.example.com/?src=...&autoplay=1'
|
|
28
28
|
</script>
|
|
29
29
|
```
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@video-lab/embed-helper",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@video-lab/protocol": "3.0
|
|
34
|
+
"@video-lab/protocol": "3.1.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"tsdown": "^0.22.9",
|