Fix player play exception on chromium
authorChocobozzz <me@florianbigard.com>
Tue, 19 Dec 2017 14:17:43 +0000 (15:17 +0100)
committerChocobozzz <me@florianbigard.com>
Tue, 19 Dec 2017 14:17:43 +0000 (15:17 +0100)
client/src/assets/player/peertube-videojs-plugin.ts
server/helpers/custom-validators/activitypub/videos.ts
server/lib/activitypub/process/process-follow.ts
server/middlewares/activitypub.ts

index d9dc2615b7d0f00dc013e84e4e353d8992a27fc0..8c131c9e9db9888f0299188983bfb048309fa5b7 100644 (file)
@@ -235,9 +235,7 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
         if (err) return handleError(err)
 
         this.renderer = renderer
-        player.play()
-
-        return done()
+        player.play().then(done)
       })
     })
 
@@ -323,10 +321,14 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
       player.updateVideoFile()
     } else {
       player.one('play', () => {
-        // Pause, we wait the video to load before
-        player.pause()
-
-        player.updateVideoFile(undefined, () => player.play())
+        // On firefox, we need to wait to load the video before playing
+        if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) {
+          player.pause()
+          player.updateVideoFile(undefined, () => player.play())
+          return
+        }
+
+        player.updateVideoFile(undefined)
       })
     }
 
index b485e5fcffac2593ce3b9a3886a0e6ef0487e06b..ae1339611a90cc0ce62b780c070bd11617a0c2e8 100644 (file)
@@ -43,8 +43,6 @@ function isActivityPubVideoDurationValid (value: string) {
 }
 
 function isVideoTorrentObjectValid (video: any) {
-  console.log(video)
-
   return video.type === 'Video' &&
     isActivityPubUrlValid(video.id) &&
     isVideoNameValid(video.name) &&
index bc02d5043835466e648804e3e2bfcd91de137b52..e78005dd06608d81147d19b9f71787edb9e2aa14 100644 (file)
@@ -62,5 +62,5 @@ async function follow (actor: ActorModel, targetActorURL: string) {
     return sendAccept(actorFollow, t)
   })
 
-  logger.info('Actor %s is followed by actor %s.', actor.url, targetActorURL)
+  logger.info('Actor %s is followed by actor %s.', targetActorURL, actor.url)
 }
index 9113e02a738a32f379bdf160874ee1fbe06560df..c00a6affa07892777ccf4394940f9acf060d0057 100644 (file)
@@ -34,7 +34,6 @@ async function checkSignature (req: Request, res: Response, next: NextFunction)
 function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) {
   return (req: Request, res: Response, next: NextFunction) => {
     const accepted = req.accepts(ACCEPT_HEADERS)
-    console.log(accepted)
     if (accepted === false || ACTIVITY_PUB.POTENTIAL_ACCEPT_HEADERS.indexOf(accepted) === -1) {
       return next()
     }