mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 05:46:43 +08:00
Merge branch 'zcwyTeacher' into 'master'
Zcwy teacher See merge request !89
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
tabindex="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
@waiting="onWaiting"
|
||||
@playing="onPlaying"
|
||||
>
|
||||
<source :src="src" />
|
||||
</video>
|
||||
@@ -358,6 +360,20 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//当视频由于需要缓冲下一帧而停止,解决一直计时的问题
|
||||
onWaiting(){
|
||||
console.log('触发了onWairing');
|
||||
this.$emit('onPlayerPause', {})
|
||||
},
|
||||
//当音频/视频在已因缓冲而暂停或停止后已就绪时
|
||||
onPlaying(){
|
||||
console.log('触发缓存结束onPlaying');
|
||||
if(this.videoDom.paused){
|
||||
this.$emit('onPlayerPause', {})
|
||||
}else{
|
||||
this.$emit('onPlayerPlay', {});
|
||||
}
|
||||
},
|
||||
/* 切换播放状态
|
||||
*/
|
||||
togglePlayStatus() {
|
||||
@@ -372,6 +388,7 @@ export default {
|
||||
this.isPlaying = true;
|
||||
this.isInit = true;
|
||||
this.$emit('onPlayerPlay', {});//播放(播放时会调用)
|
||||
console.log('播放');
|
||||
} else {
|
||||
this.videoDom.pause();
|
||||
this.isPlaying = false;
|
||||
|
||||
Reference in New Issue
Block a user