diff options
Diffstat (limited to 'client/src/app/videos/+video-watch/video-watch-playlist.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch-playlist.component.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch-playlist.component.ts b/client/src/app/videos/+video-watch/video-watch-playlist.component.ts index c5ed36000..827c34d41 100644 --- a/client/src/app/videos/+video-watch/video-watch-playlist.component.ts +++ b/client/src/app/videos/+video-watch/video-watch-playlist.component.ts | |||
@@ -9,6 +9,7 @@ import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist. | |||
9 | import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model' | 9 | import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model' |
10 | import { peertubeLocalStorage, peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage' | 10 | import { peertubeLocalStorage, peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage' |
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | 11 | import { I18n } from '@ngx-translate/i18n-polyfill' |
12 | import { SessionStorageService, LocalStorageService } from '@app/shared/misc/storage.service' | ||
12 | 13 | ||
13 | @Component({ | 14 | @Component({ |
14 | selector: 'my-video-watch-playlist', | 15 | selector: 'my-video-watch-playlist', |
@@ -42,16 +43,18 @@ export class VideoWatchPlaylistComponent { | |||
42 | private notifier: Notifier, | 43 | private notifier: Notifier, |
43 | private i18n: I18n, | 44 | private i18n: I18n, |
44 | private videoPlaylist: VideoPlaylistService, | 45 | private videoPlaylist: VideoPlaylistService, |
46 | private localStorageService: LocalStorageService, | ||
47 | private sessionStorageService: SessionStorageService, | ||
45 | private router: Router | 48 | private router: Router |
46 | ) { | 49 | ) { |
47 | // defaults to true | 50 | // defaults to true |
48 | this.autoPlayNextVideoPlaylist = this.auth.isLoggedIn() | 51 | this.autoPlayNextVideoPlaylist = this.auth.isLoggedIn() |
49 | ? this.auth.getUser().autoPlayNextVideoPlaylist | 52 | ? this.auth.getUser().autoPlayNextVideoPlaylist |
50 | : peertubeLocalStorage.getItem(VideoWatchPlaylistComponent.LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) !== 'false' | 53 | : this.localStorageService.getItem(VideoWatchPlaylistComponent.LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) !== 'false' |
51 | this.setAutoPlayNextVideoPlaylistSwitchText() | 54 | this.setAutoPlayNextVideoPlaylistSwitchText() |
52 | 55 | ||
53 | // defaults to false | 56 | // defaults to false |
54 | this.loopPlaylist = peertubeSessionStorage.getItem(VideoWatchPlaylistComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) === 'true' | 57 | this.loopPlaylist = this.sessionStorageService.getItem(VideoWatchPlaylistComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) === 'true' |
55 | this.setLoopPlaylistSwitchText() | 58 | this.setLoopPlaylistSwitchText() |
56 | } | 59 | } |
57 | 60 | ||