diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2019-12-11 22:13:20 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-12-13 09:13:43 +0100 |
commit | 88a7f93f8e5666f44121a2e3cf9d33d74c472aa7 (patch) | |
tree | 01a5d765f9ffed5cc4cbfc7b8c5fc14eb61548a7 /client/src/app/videos/+video-watch/video-watch.component.ts | |
parent | 12f18b90ba6395464606052bb1bdfedb6b83df13 (diff) | |
download | PeerTube-88a7f93f8e5666f44121a2e3cf9d33d74c472aa7.tar.gz PeerTube-88a7f93f8e5666f44121a2e3cf9d33d74c472aa7.tar.zst PeerTube-88a7f93f8e5666f44121a2e3cf9d33d74c472aa7.zip |
add loop setting for playlists, and use sessionStorage
Diffstat (limited to 'client/src/app/videos/+video-watch/video-watch.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 9 |
1 files changed, 4 insertions, 5 deletions
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 92c1c50c0..aaaa63d4d 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -2,7 +2,7 @@ import { catchError } from 'rxjs/operators' | |||
2 | import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' | 2 | import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { RedirectService } from '@app/core/routing/redirect.service' | 4 | import { RedirectService } from '@app/core/routing/redirect.service' |
5 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' | 5 | import { peertubeLocalStorage, peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage' |
6 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' | 6 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' |
7 | import { MetaService } from '@ngx-meta/core' | 7 | import { MetaService } from '@ngx-meta/core' |
8 | import { AuthUser, Notifier, ServerService } from '@app/core' | 8 | import { AuthUser, Notifier, ServerService } from '@app/core' |
@@ -46,7 +46,6 @@ import { RecommendedVideosComponent } from '../recommendations/recommended-video | |||
46 | }) | 46 | }) |
47 | export class VideoWatchComponent implements OnInit, OnDestroy { | 47 | export class VideoWatchComponent implements OnInit, OnDestroy { |
48 | private static LOCAL_STORAGE_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern' | 48 | private static LOCAL_STORAGE_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern' |
49 | private static LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO = 'auto_play_next_video' | ||
50 | 49 | ||
51 | @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent | 50 | @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent |
52 | @ViewChild('videoShareModal', { static: false }) videoShareModal: VideoShareComponent | 51 | @ViewChild('videoShareModal', { static: false }) videoShareModal: VideoShareComponent |
@@ -439,11 +438,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
439 | if (this.playlist) { | 438 | if (this.playlist) { |
440 | if ( | 439 | if ( |
441 | this.user && this.user.autoPlayNextVideoPlaylist || | 440 | this.user && this.user.autoPlayNextVideoPlaylist || |
442 | peertubeLocalStorage.getItem(VideoWatchPlaylistComponent.LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) === 'true' | 441 | peertubeSessionStorage.getItem(VideoWatchPlaylistComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) === 'true' |
443 | ) this.zone.run(() => this.videoWatchPlaylist.navigateToNextPlaylistVideo()) | 442 | ) this.zone.run(() => this.videoWatchPlaylist.navigateToNextPlaylistVideo()) |
444 | } else if ( | 443 | } else if ( |
445 | this.user && this.user.autoPlayNextVideo || | 444 | this.user && this.user.autoPlayNextVideo || |
446 | peertubeLocalStorage.getItem(RecommendedVideosComponent.LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' | 445 | peertubeSessionStorage.getItem(RecommendedVideosComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' |
447 | ) { | 446 | ) { |
448 | this.zone.run(() => this.autoplayNext()) | 447 | this.zone.run(() => this.autoplayNext()) |
449 | } | 448 | } |
@@ -453,7 +452,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
453 | if (this.playlist) { | 452 | if (this.playlist) { |
454 | if ( | 453 | if ( |
455 | this.user && this.user.autoPlayNextVideoPlaylist || | 454 | this.user && this.user.autoPlayNextVideoPlaylist || |
456 | peertubeLocalStorage.getItem(VideoWatchPlaylistComponent.LOCAL_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) === 'true' | 455 | peertubeSessionStorage.getItem(VideoWatchPlaylistComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO_PLAYLIST) === 'true' |
457 | ) this.zone.run(() => this.videoWatchPlaylist.navigateToNextPlaylistVideo()) | 456 | ) this.zone.run(() => this.videoWatchPlaylist.navigateToNextPlaylistVideo()) |
458 | } | 457 | } |
459 | }) | 458 | }) |