From b161b012ed39b7fbc52067f07928cd7367dc098c Mon Sep 17 00:00:00 2001 From: Andriy Lysnevych Date: Thu, 11 Jan 2024 18:23:05 +0200 Subject: [PATCH] ShakaPlayer on macOS fixes --- demo/src/App.tsx | 6 ++---- packages/p2p-media-loader-shaka/src/engine.ts | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/demo/src/App.tsx b/demo/src/App.tsx index 29b68473..16742f3e 100644 --- a/demo/src/App.tsx +++ b/demo/src/App.tsx @@ -179,12 +179,10 @@ function App() { const player = new DPlayer({ container: containerRef.current, video: { - url, + url: "", type: "customHlsOrDash", customType: { customHlsOrDash: (video: HTMLVideoElement) => { - video.autoplay = true; - const src = video.src; const shakaPlayer = new window.shaka.Player(); shakaPlayer.attach(video); const onError = (error: { code: number }) => { @@ -195,7 +193,7 @@ function App() { onError(event); }); engine.configureAndInitShakaPlayer(shakaPlayer); - shakaPlayer.load(src).catch(onError); + shakaPlayer.load(url).catch(onError); shakaInstance.current = shakaPlayer; }, diff --git a/packages/p2p-media-loader-shaka/src/engine.ts b/packages/p2p-media-loader-shaka/src/engine.ts index 4adbfa17..31f8bec0 100644 --- a/packages/p2p-media-loader-shaka/src/engine.ts +++ b/packages/p2p-media-loader-shaka/src/engine.ts @@ -40,6 +40,7 @@ export class Engine { "manifest.dash.ignoreSuggestedPresentationDelay", true ); + this.player.configure("streaming.useNativeHlsOnSafari", false); this.updatePlayerEventHandlers("register"); }