Commit 57cb2b09 by Tianqing Liu

feat: 播放器使用pro文件

1 parent e4270c09
...@@ -18,10 +18,10 @@ export default { ...@@ -18,10 +18,10 @@ export default {
init(params = {}) { init(params = {}) {
const options = Object.assign({ const options = Object.assign({
container: this.$refs.container, container: this.$refs.container,
decoder: './jessibuca/decoder.js', decoder: '/jessibuca-pro/decoder-pro.js',
isResize: false, isResize: false,
text: '', // TODO: 功能暂不清楚 text: '', // TODO: 功能暂不清楚
useMSE: false, useMSE: true,
useWCS: false, useWCS: false,
isNotMute: false, isNotMute: false,
timeout: 10, timeout: 10,
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}, },
}); });
this._jessibuca = new window.Jessibuca(options); this._jessibuca = new window.JessibucaPro(options);
this.registerEvent(this._jessibuca); this.registerEvent(this._jessibuca);
}, },
...@@ -61,11 +61,15 @@ export default { ...@@ -61,11 +61,15 @@ export default {
pause() { pause() {
this._jessibuca.pause(); this._jessibuca.pause();
}, },
stop() {
this._jessibuca.pause(true);
},
destroy() { destroy() {
if (this._jessibuca) { if (this._jessibuca) {
this._jessibuca.destroy(); this._jessibuca.destroy().then(() => {
this._jessibuca = null;
});
} }
this.init();
}, },
}, },
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<!-- <button @click="handlePlayback">回放</button> --> <!-- <button @click="handlePlayback">回放</button> -->
<button @click="handlePause">暂停</button> <button @click="handlePause">暂停</button>
<button @click="handleStop">停止</button> <button @click="handleStop">停止</button>
<button @click="handleDestroy">销毁</button>
<!-- <button @click="handleScreenshot">抓拍</button> --> <!-- <button @click="handleScreenshot">抓拍</button> -->
</div> </div>
</div> </div>
...@@ -65,6 +66,9 @@ export default { ...@@ -65,6 +66,9 @@ export default {
this.$refs.vionPlayer.pause(); this.$refs.vionPlayer.pause();
}, },
handleStop() { handleStop() {
this.$refs.vionPlayer.stop();
},
handleDestroy() {
this.$refs.vionPlayer.destroy(); this.$refs.vionPlayer.destroy();
}, },
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!