]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts
Force videojs to not recreate <video>
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / shared / p2p-media-loader / p2p-media-loader-plugin.ts
index 0757aa5ded048c50358c0978a7c21a28a165e0a5..b608ee3e230c24968ae1a68e1f9b24ae7d1ff866 100644 (file)
@@ -66,6 +66,9 @@ class P2pMediaLoaderPlugin extends Plugin {
         player.ready(() => player.error(error))
         return
       }
+
+      // Workaround to force video.js to not re create a video element
+      (this.player as any).playerElIngest_ = this.player.el().parentNode
     } else {
       // FIXME: typings https://github.com/Microsoft/TypeScript/issues/14080
       (videojs as any).Html5Hlsjs.addHook('beforeinitialize', (videojsPlayer: any, hlsjs: any) => {