diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index 4fcf67609..ca5661595 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - 新增 `option.proxy` 选项,用于代理第三方的 `video` 和 `canvas` +- 新增 `artplayer-proxy-canvas` 代理 - 新增 `artplayer-proxy-webav` 代理,来自 [bilibili/WebAV](https://github.com/bilibili/WebAV) - 新增 `option.thumbnails.scale`, 用于预览图缩放 - 修复更改 `art.url` 不能触发 `autoPlayBack` 的 `bug`: [#797](https://github.com/zhw2590582/ArtPlayer/issues/797) diff --git a/README.md b/README.md index 9b688e724..ac49eb6a5 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ var art = new Artplayer({ ## Proxys +- [Canvas](https://artplayer.org/?libs=./uncompiled/artplayer-proxy-canvas/index.js&example=canvas) (WIP) - [WebAV](https://artplayer.org/?libs=./uncompiled/artplayer-proxy-webav/index.js&example=webav) (WIP) ## Changelog diff --git a/docs/assets/example/canvas.js b/docs/assets/example/canvas.js new file mode 100644 index 000000000..19fbba0ef --- /dev/null +++ b/docs/assets/example/canvas.js @@ -0,0 +1,28 @@ +// npm i artplayer-proxy-canvas +// import artplayerProxyCanvas from 'artplayer-proxy-canvas'; + +var art = new Artplayer({ + container: '.artplayer-app', + url: '/assets/sample/frag_bunny.mp4', + volume: 0.5, + autoplay: false, + autoSize: false, + screenshot: true, + setting: true, + loop: true, + flip: true, + playbackRate: true, + aspectRatio: true, + fullscreen: true, + fullscreenWeb: true, + miniProgressBar: true, + autoPlayback: true, + thumbnails: { + url: '/assets/sample/bbb-sprite.jpg', + number: 121, + column: 11, + width: 128, + height: 72, + }, + proxy: artplayerProxyCanvas(), +}); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index b26eec189..d99321ad3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -102,6 +102,10 @@