@@ -21,11 +24,10 @@
ref="videoPlayer"
:video="video"
:sponsors="sponsors"
- :playlist="playlist"
- :index="index"
:selected-auto-play="selectedAutoPlay"
:selected-auto-loop="selectedAutoLoop"
@timeupdate="onTimeUpdate"
+ @ended="onVideoEnded"
/>
0 || this.video.relatedStreams.length > 0)
+ ) {
+ this.showToast();
+ }
+ },
+ showToast() {
+ this.counter = this.defaultCounter;
+ if (this.counter < 1) {
+ this.navigateNext();
+ return;
+ }
+ if (this.timeoutCounter) clearInterval(this.timeoutCounter);
+ this.timeoutCounter = setInterval(() => {
+ this.counter--;
+ if (this.counter === 0) {
+ this.dismiss();
+ this.navigateNext();
+ }
+ }, 1000);
+ this.shouldShowToast = true;
+ },
+ dismiss() {
+ clearInterval(this.timeoutCounter);
+ this.shouldShowToast = false;
+ },
+ navigateNext() {
+ const params = this.$route.query;
+ let url = this.playlist?.relatedStreams?.[this.index]?.url ?? this.video.relatedStreams[0].url;
+ const searchParams = new URLSearchParams();
+ for (var param in params)
+ switch (param) {
+ case "v":
+ case "t":
+ break;
+ case "index":
+ if (this.index < this.playlist.relatedStreams.length) searchParams.set("index", this.index + 1);
+ break;
+ case "list":
+ if (this.index < this.playlist.relatedStreams.length) searchParams.set("list", params.list);
+ break;
+ default:
+ searchParams.set(param, params[param]);
+ break;
+ }
+ // save the fullscreen state
+ searchParams.set("fullscreen", this.$refs.videoPlayer.$ui.getControls().isFullScreenEnabled());
+ const paramStr = searchParams.toString();
+ if (paramStr.length > 0) url += "&" + paramStr;
+ this.$router.push(url);
+ },
},
};
+
+
diff --git a/src/locales/en.json b/src/locales/en.json
index 6ddfab97..0b0d5ac5 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -49,6 +49,7 @@
"dark": "Dark",
"light": "Light",
"autoplay_video": "Autoplay Video",
+ "autoplay_next_countdown": "Default Countdown until next video (in seconds)",
"audio_only": "Audio Only",
"default_quality": "Default Quality",
"buffering_goal": "Buffering Goal (in seconds)",
@@ -127,7 +128,8 @@
"no_valid_playlists": "The file doesn't contain valid playlists!",
"with_playlist": "Share with playlist",
"bookmark_playlist": "Bookmark",
- "playlist_bookmarked": "Bookmarked"
+ "playlist_bookmarked": "Bookmarked",
+ "dismiss": "Dismiss"
},
"comment": {
"pinned_by": "Pinned by {author}",
@@ -180,6 +182,7 @@
"copied": "Copied!",
"cannot_copy": "Can't copy!",
"local_storage": "This action requires localStorage, are cookies enabled?",
- "register_no_email_note": "Using an e-mail as username is not recommended. Proceed anyways?"
+ "register_no_email_note": "Using an e-mail as username is not recommended. Proceed anyways?",
+ "next_video_countdown": "Playing next video in {0}s"
}
}