Prevent PiP video from repeating if video is finished. Also prevent it from holding up navigation on rare occasions
This commit is contained in:
parent
32c3e143c8
commit
6bf54a1dd7
|
@ -663,14 +663,15 @@ export default Vue.extend({
|
|||
this.updateWatchProgress(payload)
|
||||
}
|
||||
|
||||
if (player.isInPictureInPicture()) {
|
||||
if (player !== null && !player.paused() && player.isInPictureInPicture()) {
|
||||
const playerId = this.videoId
|
||||
setTimeout(() => {
|
||||
player.play()
|
||||
player.on('leavepictureinpicture', () => {
|
||||
const watchTime = player.currentTime()
|
||||
if (this.$route.fullPath.includes('/watch')) {
|
||||
const routeId = this.$route.params.id
|
||||
if (routeId === this.videoId) {
|
||||
if (routeId === playerId) {
|
||||
const activePlayer = $('.ftVideoPlayer video').get(0)
|
||||
activePlayer.currentTime = watchTime
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue