Skip to content

Commit 6390425

Browse files
authored
Merge pull request surmon-china#32 from SergKazakov/master
Add canplay and canplaythrough events
2 parents b573c05 + b217efd commit 6390425

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

player.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,16 @@
238238
_this.$emit && _this.$emit(customEventName, { currentTime: this.currentTime() })
239239
_this.$dispatch && _this.$dispatch(customEventName, { currentTime: this.currentTime() })
240240
})
241+
242+
this.on('canplay', function() {
243+
_this.$emit && _this.$emit(customEventName, { canplay: true })
244+
_this.$dispatch && _this.$dispatch(customEventName, { canplay: true })
245+
})
246+
247+
this.on('canplaythrough', function() {
248+
_this.$emit && _this.$emit(customEventName, { canplaythrough: true })
249+
_this.$dispatch && _this.$dispatch(customEventName, { canplaythrough: true })
250+
})
241251
})
242252
},
243253
// 释放播放器

0 commit comments

Comments
 (0)