Skip to content

Commit 1c75731

Browse files
committed
feat: introduce ArtplayerToolIframe for iframe control
- Removed the old ArtplayerPluginIframe implementation. - Added ArtplayerToolIframe class with methods for iframe communication. - Implemented postMessage and onMessage methods for message handling. - Created a new TypeScript definition file for ArtplayerToolIframe. - Updated documentation links to point to the new iframe tool. - Added npm ignore file and README for the new package. - Included compiled and uncompiled versions of the new iframe tool. - Updated package.json with relevant metadata and exports.
1 parent 78e9cc7 commit 1c75731

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+331
-178
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ const option = {
265265

266266
- Add `art.type` property to get/set video type
267267
- Add `art.video` property to get video element
268-
- Add `artplayer-plugin-iframe` plugin to control player inside iframe
268+
- Add `artplayer-tool-iframe` plugin to control player inside iframe
269269
- Add `artplayer-plugin-hls-quality` plugin for adding Hls quality list
270270
- Add `Artplayer.PLAYBACK_RATE` for default playback rates `[0.5, 0.75, 1, 1.25, 1.5, 2]`
271271
- Add `Artplayer.ASPECT_RATIO` for default ratios `['default','4:3','16:9']`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ let art = new Artplayer({
103103
| Name | Describe | State |
104104
| :--- | :--- | :--- |
105105
| [artplayer-plugin-danmuku](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-danmuku/index.js&example=danmuku) | Danmuku (bullet comment) system | <img src="https://img.shields.io/npm/v/artplayer-plugin-danmuku.svg?sanitize=true"><br><img src="https://img.shields.io/npm/dm/artplayer-plugin-danmuku.svg?sanitize=true"> |
106-
| [artplayer-plugin-iframe](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-iframe/index.js&example=iframe) | Control player via iframe | <img src="https://img.shields.io/npm/v/artplayer-plugin-iframe.svg?sanitize=true"><br><img src="https://img.shields.io/npm/dm/artplayer-plugin-iframe.svg?sanitize=true"> |
106+
| [artplayer-tool-iframe](https://artplayer.org/?libs=./uncompiled/artplayer-tool-iframe/index.js&example=iframe) | Control player via iframe | <img src="https://img.shields.io/npm/v/artplayer-tool-iframe.svg?sanitize=true"><br><img src="https://img.shields.io/npm/dm/artplayer-tool-iframe.svg?sanitize=true"> |
107107
| [artplayer-plugin-hls-control](https://artplayer.org/?libs=https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.5.17/hls.min.js%0A./uncompiled/artplayer-plugin-hls-control/index.js&example=hls.control) | HLS quality control | <img src="https://img.shields.io/npm/v/artplayer-plugin-hls-control.svg?sanitize=true"><br><img src="https://img.shields.io/npm/dm/artplayer-plugin-hls-control.svg?sanitize=true"> |
108108
| [artplayer-plugin-dash-control](https://artplayer.org/?libs=https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.5.2/dash.all.min.js%0A./uncompiled/artplayer-plugin-dash-control/index.js&example=dash.control) | DASH quality control | <img src="https://img.shields.io/npm/v/artplayer-plugin-dash-control.svg?sanitize=true"><br><img src="https://img.shields.io/npm/dm/artplayer-plugin-dash-control.svg?sanitize=true"> |
109109
| [artplayer-plugin-vtt-thumbnail](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-vtt-thumbnail/index.js&example=vtt.thumbnail) | VTT thumbnail preview | <img src="https://img.shields.io/npm/v/artplayer-plugin-vtt-thumbnail.svg?sanitize=true"><br><img src="https://img.shields.io/npm/dm/artplayer-plugin-vtt-thumbnail.svg?sanitize=true"> |

docs/assets/example/iframe.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// npm i artplayer-plugin-iframe
2-
// import ArtplayerPluginIframe from 'artplayer-plugin-iframe';
1+
// npm i artplayer-tool-iframe
2+
// import ArtplayerToolIframe from 'artplayer-tool-iframe';
33

44
const $iframe = document.createElement('iframe')
55
$iframe.allowFullscreen = true
@@ -10,7 +10,7 @@ const $container = document.querySelector('.artplayer-app')
1010
$container.innerHTML = ''
1111
$container.appendChild($iframe)
1212

13-
const iframe = new ArtplayerPluginIframe({
13+
const iframe = new ArtplayerToolIframe({
1414
iframe: $iframe,
1515
url: '/iframe.html',
1616
})
@@ -39,7 +39,7 @@ iframe.commit(() => {
3939
})
4040

4141
art.on('fullscreenWeb', (state) => {
42-
ArtplayerPluginIframe.postMessage({
42+
ArtplayerToolIframe.postMessage({
4343
type: 'fullscreenWeb',
4444
data: state,
4545
})

docs/assets/js/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@
6363
'./assets/ts/artplayer-plugin-dash-control.d.ts',
6464
'./assets/ts/artplayer-plugin-document-pip.d.ts',
6565
'./assets/ts/artplayer-plugin-hls-control.d.ts',
66-
'./assets/ts/artplayer-plugin-iframe.d.ts',
6766
'./assets/ts/artplayer-plugin-jassub.d.ts',
6867
'./assets/ts/artplayer-plugin-multiple-subtitles.d.ts',
6968
'./assets/ts/artplayer-plugin-vast.d.ts',
7069
'./assets/ts/artplayer-plugin-vtt-thumbnail.d.ts',
7170
'./assets/ts/artplayer-plugin-websr.d.ts',
7271
'./assets/ts/artplayer-proxy-canvas.d.ts',
7372
'./assets/ts/artplayer-proxy-mediabunny.d.ts',
73+
'./assets/ts/artplayer-tool-iframe.d.ts',
7474
'./assets/ts/artplayer.d.ts',
7575
]
7676

docs/assets/ts/artplayer-plugin-iframe.d.ts renamed to docs/assets/ts/artplayer-tool-iframe.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface Message {
44
id?: number
55
}
66

7-
declare class ArtplayerPluginIframe {
7+
declare class ArtplayerToolIframe {
88
constructor(option: { iframe: HTMLIFrameElement, url: string })
99

1010
static iframe: boolean
@@ -26,7 +26,7 @@ declare class ArtplayerPluginIframe {
2626
destroy(): void
2727
}
2828

29-
export default ArtplayerPluginIframe
29+
export default ArtplayerToolIframe
3030

31-
export = artplayerPluginIframe
32-
export as namespace artplayerPluginIframe;
31+
export = artplayerToolIframe
32+
export as namespace artplayerToolIframe;

docs/compiled/artplayer-plugin-iframe.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/compiled/artplayer-plugin-iframe.legacy.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)