Verify paused player before autoplaying next video (#1089)
This prevents the autoplay from playing the next video if the current video gets manually replayed by the user
This commit is contained in:
parent
7eda649293
commit
a26750aa2e
|
@ -842,7 +842,10 @@ export default Vue.extend({
|
||||||
const nextVideoInterval = this.defaultInterval
|
const nextVideoInterval = this.defaultInterval
|
||||||
if (this.watchingPlaylist) {
|
if (this.watchingPlaylist) {
|
||||||
this.playNextTimeout = setTimeout(() => {
|
this.playNextTimeout = setTimeout(() => {
|
||||||
this.$refs.watchVideoPlaylist.playNextVideo()
|
const player = this.$refs.videoPlayer.player
|
||||||
|
if (player !== null && player.paused()) {
|
||||||
|
this.$refs.watchVideoPlaylist.playNextVideo()
|
||||||
|
}
|
||||||
}, nextVideoInterval * 1000)
|
}, nextVideoInterval * 1000)
|
||||||
|
|
||||||
this.showToast({
|
this.showToast({
|
||||||
|
@ -857,15 +860,18 @@ export default Vue.extend({
|
||||||
})
|
})
|
||||||
} else if (this.playNextVideo) {
|
} else if (this.playNextVideo) {
|
||||||
this.playNextTimeout = setTimeout(() => {
|
this.playNextTimeout = setTimeout(() => {
|
||||||
const nextVideoId = this.recommendedVideos[0].videoId
|
const player = this.$refs.videoPlayer.player
|
||||||
this.$router.push(
|
if (player !== null && player.paused()) {
|
||||||
{
|
const nextVideoId = this.recommendedVideos[0].videoId
|
||||||
path: `/watch/${nextVideoId}`
|
this.$router.push(
|
||||||
}
|
{
|
||||||
)
|
path: `/watch/${nextVideoId}`
|
||||||
this.showToast({
|
}
|
||||||
message: this.$t('Playing Next Video')
|
)
|
||||||
})
|
this.showToast({
|
||||||
|
message: this.$t('Playing Next Video')
|
||||||
|
})
|
||||||
|
}
|
||||||
}, 5000)
|
}, 5000)
|
||||||
|
|
||||||
this.showToast({
|
this.showToast({
|
||||||
|
|
Loading…
Reference in New Issue