]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/video-watch.component.ts
Fix anonymous nsfw policy
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / video-watch.component.ts
index 9ba14316caa5388b06e31b061a874225187ed170..df0c1058ce10296e961f7f0f71055ccbfb36dff7 100644 (file)
@@ -335,7 +335,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
       this.videoCaptionService.listCaptions(videoId)
     ])
       .pipe(
-        // If 401, the video is private or blacklisted so redirect to 404
+        // If 401, the video is private or blocked so redirect to 404
         catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 401, 403, 404 ]))
       )
       .subscribe(([ video, captionsResult ]) => {
@@ -364,7 +364,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
 
     this.playlistService.getVideoPlaylist(playlistId)
       .pipe(
-        // If 401, the video is private or blacklisted so redirect to 404
+        // If 401, the video is private or blocked so redirect to 404
         catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 401, 403, 404 ]))
       )
       .subscribe(playlist => {
@@ -541,7 +541,9 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
   }
 
   private autoplayNext () {
-    if (this.nextVideoUuid) {
+    if (this.playlist) {
+      this.zone.run(() => this.videoWatchPlaylist.navigateToNextPlaylistVideo())
+    } else if (this.nextVideoUuid) {
       this.router.navigate([ '/videos/watch', this.nextVideoUuid ])
     }
   }
@@ -715,6 +717,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
       else mode = 'webtorrent'
     }
 
+    // p2p-media-loader needs TextEncoder, try to fallback on WebTorrent
+    if (typeof TextEncoder === 'undefined') {
+      mode = 'webtorrent'
+    }
+
     if (mode === 'p2p-media-loader') {
       const hlsPlaylist = video.getHlsPlaylist()