mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Fix HLS player on mobile
This commit is contained in:
@@ -20,6 +20,8 @@ type Metadata = {
|
||||
|
||||
type HookFn = (player: videojs.Player, hljs: Hlsjs) => void
|
||||
|
||||
let alreadyRegistered = false
|
||||
|
||||
const registerSourceHandler = function (vjs: typeof videojs) {
|
||||
if (!Hlsjs.isSupported()) {
|
||||
logger.warn('Hls.js is not supported in this browser!')
|
||||
@@ -33,8 +35,9 @@ const registerSourceHandler = function (vjs: typeof videojs) {
|
||||
return
|
||||
}
|
||||
|
||||
// Already registered
|
||||
if ((html5 as any).canPlaySource({ type: 'application/x-mpegURL' })) return
|
||||
if (alreadyRegistered) return
|
||||
|
||||
alreadyRegistered = true;
|
||||
|
||||
// FIXME: typings
|
||||
(html5 as any).registerSourceHandler({
|
||||
|
||||
Reference in New Issue
Block a user