Commit 27df8bd84cfceb4154bb7543a7d1fc58fc8d1b04
1 parent
59aec113
添加丢失的文件
Showing
1 changed file
with
57 additions
and
0 deletions
web_src/src/components/dialog/easyPlayer.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div id="player"> | ||
| 3 | + <div id="easyplayer"></div> | ||
| 4 | + </div> | ||
| 5 | +</template> | ||
| 6 | + | ||
| 7 | +<script> | ||
| 8 | +export default { | ||
| 9 | + name: 'player', | ||
| 10 | + data() { | ||
| 11 | + return { | ||
| 12 | + easyPlayer: null | ||
| 13 | + }; | ||
| 14 | + }, | ||
| 15 | + props: ['videoUrl', 'error', 'hasaudio'], | ||
| 16 | + mounted () { | ||
| 17 | + this.$nextTick(() =>{ | ||
| 18 | + console.log("初始化时的地址为: " + this.videoUrl) | ||
| 19 | + this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK) | ||
| 20 | + this.easyPlayer.play(this.videoUrl, 1) | ||
| 21 | + }) | ||
| 22 | + }, | ||
| 23 | + watch:{ | ||
| 24 | + videoUrl(newData, oldData){ | ||
| 25 | + this.easyPlayer.destroy() | ||
| 26 | + this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK) | ||
| 27 | + this.easyPlayer.play(newData, 1) | ||
| 28 | + }, | ||
| 29 | + immediate:true | ||
| 30 | + }, | ||
| 31 | + methods: { | ||
| 32 | + play: function (url) { | ||
| 33 | + this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK) | ||
| 34 | + this.easyPlayer.play(url, 1) | ||
| 35 | + }, | ||
| 36 | + pause: function () { | ||
| 37 | + this.easyPlayer.destroy(); | ||
| 38 | + }, | ||
| 39 | + eventcallbacK: function(type, message) { | ||
| 40 | + console.log("player 事件回调") | ||
| 41 | + console.log(type) | ||
| 42 | + console.log(message) | ||
| 43 | + } | ||
| 44 | + }, | ||
| 45 | +} | ||
| 46 | +</script> | ||
| 47 | + | ||
| 48 | +<style> | ||
| 49 | + .LodingTitle { | ||
| 50 | + min-width: 70px; | ||
| 51 | + } | ||
| 52 | + /* 隐藏logo */ | ||
| 53 | + /* .iconqingxiLOGO { | ||
| 54 | + display: none !important; | ||
| 55 | + } */ | ||
| 56 | + | ||
| 57 | +</style> |