From d816f3a063febac1cad09ab3a32e5f0d29353627 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 10 Dec 2019 23:15:09 +0100 Subject: autoplay next video switch for both user and visitors --- client/src/app/videos/+video-watch/video-watch.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'client/src/app/videos/+video-watch') diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 0de621aca..156a3235a 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -45,6 +45,7 @@ import { randomInt } from '@shared/core-utils/miscs/miscs' }) export class VideoWatchComponent implements OnInit, OnDestroy { private static LOCAL_STORAGE_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern' + private static LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO = 'auto_play_next_video' @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent @ViewChild('videoShareModal', { static: false }) videoShareModal: VideoShareComponent @@ -436,7 +437,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.player.one('ended', () => { if (this.playlist) { this.zone.run(() => this.videoWatchPlaylist.navigateToNextPlaylistVideo()) - } else if (this.user && this.user.autoPlayNextVideo) { + } else if ( + this.user && this.user.autoPlayNextVideo || + peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' + ) { this.zone.run(() => this.autoplayNext()) } }) -- cgit v1.2.3