|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="ezy-video-box course-video-box">
|
|
|
- <view ref="videoContent" :id="cId" :playAuth="playAuth1"
|
|
|
+ <view ref="videoContent" id="video-play1" :playAuth="playAuth1"
|
|
|
:change:playAuth="renderScript.receiveMsg" :videoId="videoId1" :change:videoId="renderScript.videoIdFun"
|
|
|
:hideFlag="hideFlag1" :change:hideFlag="renderScript.hideFlagFun" :progressMarkers="progressMarkers1"
|
|
|
:change:progressMarkers="renderScript.progressMarkersMsg" :seekTime="seekTime1"
|
|
|
@@ -10,6 +10,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import {MyRenderEventBus} from "./renderEvents"
|
|
|
export default {
|
|
|
name: "videoPlay",
|
|
|
props: {
|
|
|
@@ -38,19 +39,20 @@
|
|
|
},
|
|
|
methods: {
|
|
|
handleStop() {
|
|
|
- uni.$emit(`renderjs:video-stop${this.cId}`)
|
|
|
+ MyRenderEventBus.$emit('video-play1')
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<script module="renderScript" lang="renderjs">
|
|
|
+ import {MyRenderEventBus} from "./renderEvents";
|
|
|
export default {
|
|
|
mounted() {
|
|
|
- uni.$on(`renderjs:video-stop${this.$ownerInstance.$vm.cId}`, this.stopPlayer)
|
|
|
+ MyRenderEventBus.$on(`video-play1`, this.stopPlayer)
|
|
|
},
|
|
|
Unmounted() {
|
|
|
- uni.$ff(`renderjs:video-stop${this.$ownerInstance.$vm.cId}`, this.stopPlayer)
|
|
|
+ MyRenderEventBus.$ff(`video-play1`, this.stopPlayer)
|
|
|
},
|
|
|
data() {
|
|
|
|
|
|
@@ -64,6 +66,12 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 通用的方法调用器
|
|
|
+ handleRenderMethod(methodName, params) {
|
|
|
+ if (this[methodName] && typeof this[methodName] === 'function') {
|
|
|
+ return this[methodName](params)
|
|
|
+ }
|
|
|
+ },
|
|
|
stopPlayer() {
|
|
|
this.player && this.player.pause();
|
|
|
},
|
|
|
@@ -104,7 +112,7 @@
|
|
|
return false;
|
|
|
}
|
|
|
var player = new Aliplayer({
|
|
|
- id: this.$ownerInstance.$vm.cId,
|
|
|
+ id: 'video-play1',
|
|
|
"vid": this.videoId,
|
|
|
"playauth": this.playAuth,
|
|
|
extraInfo: {
|
|
|
@@ -206,7 +214,6 @@
|
|
|
s_tag.charset = 'utf-8';
|
|
|
s_tag.onload = () => {
|
|
|
// console.log(this.playAuth);
|
|
|
- console.log('this.loadWebPlayerSDK', this.$ownerInstance.$vm.cId)
|
|
|
this.playAli()
|
|
|
resolve();
|
|
|
}
|