diff --git a/src/Constants.js b/src/Constants.js index 3cbfaaff..838b169e 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -1,3 +1,4 @@ export default { BASE_URL: localStorage.getItem("instance") || 'https://pipedapi.kavin.rocks', + AUTO_PLAY: localStorage.getItem("autoplay") || false } diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index bb5fa793..c457c1f0 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -33,6 +33,14 @@
+ Auto Play next Video:  + +
(this.video = data)) @@ -246,6 +259,16 @@ export default { this.player.on("volumechange", () => { this.audioplayer.volume = this.player.volume(); }); + + this.player.on("ended", () => { + if ( + this.selectedAutoPlay && + this.video.relatedStreams.length > 0 + ) + this.$router.push( + this.video.relatedStreams[0].url + ); + }); } if (!noPrevPlayer)