Fix player play exception on chromium
This commit is contained in:
parent
232f04c809
commit
85414add64
|
@ -235,9 +235,7 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
|
||||||
if (err) return handleError(err)
|
if (err) return handleError(err)
|
||||||
|
|
||||||
this.renderer = renderer
|
this.renderer = renderer
|
||||||
player.play()
|
player.play().then(done)
|
||||||
|
|
||||||
return done()
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -323,10 +321,14 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
|
||||||
player.updateVideoFile()
|
player.updateVideoFile()
|
||||||
} else {
|
} else {
|
||||||
player.one('play', () => {
|
player.one('play', () => {
|
||||||
// Pause, we wait the video to load before
|
// On firefox, we need to wait to load the video before playing
|
||||||
|
if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) {
|
||||||
player.pause()
|
player.pause()
|
||||||
|
|
||||||
player.updateVideoFile(undefined, () => player.play())
|
player.updateVideoFile(undefined, () => player.play())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
player.updateVideoFile(undefined)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,6 @@ function isActivityPubVideoDurationValid (value: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isVideoTorrentObjectValid (video: any) {
|
function isVideoTorrentObjectValid (video: any) {
|
||||||
console.log(video)
|
|
||||||
|
|
||||||
return video.type === 'Video' &&
|
return video.type === 'Video' &&
|
||||||
isActivityPubUrlValid(video.id) &&
|
isActivityPubUrlValid(video.id) &&
|
||||||
isVideoNameValid(video.name) &&
|
isVideoNameValid(video.name) &&
|
||||||
|
|
|
@ -62,5 +62,5 @@ async function follow (actor: ActorModel, targetActorURL: string) {
|
||||||
return sendAccept(actorFollow, t)
|
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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ async function checkSignature (req: Request, res: Response, next: NextFunction)
|
||||||
function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) {
|
function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) {
|
||||||
return (req: Request, res: Response, next: NextFunction) => {
|
return (req: Request, res: Response, next: NextFunction) => {
|
||||||
const accepted = req.accepts(ACCEPT_HEADERS)
|
const accepted = req.accepts(ACCEPT_HEADERS)
|
||||||
console.log(accepted)
|
|
||||||
if (accepted === false || ACTIVITY_PUB.POTENTIAL_ACCEPT_HEADERS.indexOf(accepted) === -1) {
|
if (accepted === false || ACTIVITY_PUB.POTENTIAL_ACCEPT_HEADERS.indexOf(accepted) === -1) {
|
||||||
return next()
|
return next()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue