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"); }