diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-19 15:17:43 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-19 15:17:43 +0100 |
commit | 85414add64d2215a44866471913a8470638742e4 (patch) | |
tree | 3612797b9e155c6c9df059cbdd11a0a7a1fcf011 | |
parent | 232f04c809bf25952b790da5685b36f05cb19750 (diff) | |
download | PeerTube-85414add64d2215a44866471913a8470638742e4.tar.gz PeerTube-85414add64d2215a44866471913a8470638742e4.tar.zst PeerTube-85414add64d2215a44866471913a8470638742e4.zip |
Fix player play exception on chromium
-rw-r--r-- | client/src/assets/player/peertube-videojs-plugin.ts | 16 | ||||
-rw-r--r-- | server/helpers/custom-validators/activitypub/videos.ts | 2 | ||||
-rw-r--r-- | server/lib/activitypub/process/process-follow.ts | 2 | ||||
-rw-r--r-- | server/middlewares/activitypub.ts | 1 |
4 files changed, 10 insertions, 11 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index d9dc2615b..8c131c9e9 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts | |||
@@ -235,9 +235,7 @@ const peertubePlugin = function (options: PeertubePluginOptions) { | |||
235 | if (err) return handleError(err) | 235 | if (err) return handleError(err) |
236 | 236 | ||
237 | this.renderer = renderer | 237 | this.renderer = renderer |
238 | player.play() | 238 | player.play().then(done) |
239 | |||
240 | return done() | ||
241 | }) | 239 | }) |
242 | }) | 240 | }) |
243 | 241 | ||
@@ -323,10 +321,14 @@ const peertubePlugin = function (options: PeertubePluginOptions) { | |||
323 | player.updateVideoFile() | 321 | player.updateVideoFile() |
324 | } else { | 322 | } else { |
325 | player.one('play', () => { | 323 | player.one('play', () => { |
326 | // Pause, we wait the video to load before | 324 | // On firefox, we need to wait to load the video before playing |
327 | player.pause() | 325 | if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) { |
328 | 326 | player.pause() | |
329 | player.updateVideoFile(undefined, () => player.play()) | 327 | player.updateVideoFile(undefined, () => player.play()) |
328 | return | ||
329 | } | ||
330 | |||
331 | player.updateVideoFile(undefined) | ||
330 | }) | 332 | }) |
331 | } | 333 | } |
332 | 334 | ||
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index b485e5fcf..ae1339611 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts | |||
@@ -43,8 +43,6 @@ function isActivityPubVideoDurationValid (value: string) { | |||
43 | } | 43 | } |
44 | 44 | ||
45 | function isVideoTorrentObjectValid (video: any) { | 45 | function isVideoTorrentObjectValid (video: any) { |
46 | console.log(video) | ||
47 | |||
48 | return video.type === 'Video' && | 46 | return video.type === 'Video' && |
49 | isActivityPubUrlValid(video.id) && | 47 | isActivityPubUrlValid(video.id) && |
50 | isVideoNameValid(video.name) && | 48 | isVideoNameValid(video.name) && |
diff --git a/server/lib/activitypub/process/process-follow.ts b/server/lib/activitypub/process/process-follow.ts index bc02d5043..e78005dd0 100644 --- a/server/lib/activitypub/process/process-follow.ts +++ b/server/lib/activitypub/process/process-follow.ts | |||
@@ -62,5 +62,5 @@ async function follow (actor: ActorModel, targetActorURL: string) { | |||
62 | return sendAccept(actorFollow, t) | 62 | return sendAccept(actorFollow, t) |
63 | }) | 63 | }) |
64 | 64 | ||
65 | logger.info('Actor %s is followed by actor %s.', actor.url, targetActorURL) | 65 | logger.info('Actor %s is followed by actor %s.', targetActorURL, actor.url) |
66 | } | 66 | } |
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts index 9113e02a7..c00a6affa 100644 --- a/server/middlewares/activitypub.ts +++ b/server/middlewares/activitypub.ts | |||
@@ -34,7 +34,6 @@ async function checkSignature (req: Request, res: Response, next: NextFunction) | |||
34 | function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) { | 34 | function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) { |
35 | return (req: Request, res: Response, next: NextFunction) => { | 35 | return (req: Request, res: Response, next: NextFunction) => { |
36 | const accepted = req.accepts(ACCEPT_HEADERS) | 36 | const accepted = req.accepts(ACCEPT_HEADERS) |
37 | console.log(accepted) | ||
38 | if (accepted === false || ACTIVITY_PUB.POTENTIAL_ACCEPT_HEADERS.indexOf(accepted) === -1) { | 37 | if (accepted === false || ACTIVITY_PUB.POTENTIAL_ACCEPT_HEADERS.indexOf(accepted) === -1) { |
39 | return next() | 38 | return next() |
40 | } | 39 | } |