|
@@ -17,6 +17,8 @@
|
|
|
:playbackRate="playbackRate"
|
|
|
:isAllowSeek="isAllowSeek"
|
|
|
:autoplay="autoplay"
|
|
|
+ :startTime="startTime"
|
|
|
+ @statechange="onStateChange"
|
|
|
></polyv-player>
|
|
|
</view>
|
|
|
<view style="padding:20rpx;height: 120rpx;">
|
|
@@ -110,7 +112,8 @@ export default {
|
|
|
autoplay:true,
|
|
|
listenConfigList:[],
|
|
|
listenSecond:0,
|
|
|
- timer:null
|
|
|
+ timer:null,
|
|
|
+ startTime:0
|
|
|
};
|
|
|
},
|
|
|
onUnload() {
|
|
@@ -140,17 +143,33 @@ export default {
|
|
|
if(this.timer){
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
|
- this.timer = setInterval(this.timeEvent, 2000);//定时器
|
|
|
- this.vid = item.recordingUrl
|
|
|
+ if(this.vid){
|
|
|
+ //切换视频
|
|
|
+ var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
+ polyvPlayerContext.changeVid(item.recordingUrl)
|
|
|
+ }else{
|
|
|
+ this.vid = item.recordingUrl
|
|
|
+ }
|
|
|
+
|
|
|
this.startStatus = true
|
|
|
+ this.startTime = 0
|
|
|
}else{
|
|
|
- console.log(this.listenSecond,333)
|
|
|
this.$u.toast('试听配置错误');
|
|
|
}
|
|
|
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ onStateChange(newstate, oldstate) {
|
|
|
+ if (newstate.detail.newstate == 'playing') {
|
|
|
+ //开始播放
|
|
|
+ if(this.timer){
|
|
|
+ clearInterval(this.timer);
|
|
|
+ }
|
|
|
+ this.timer = setInterval(this.timeEvent, 2000);//定时器
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
closePlay(){
|
|
|
this.vid = ""
|
|
|
this.startStatus = false
|