Skip to content

Commit

Permalink
ShakaPlayer on macOS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlika committed Jan 11, 2024
1 parent 0fac53c commit b161b01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand All @@ -195,7 +193,7 @@ function App() {
onError(event);
});
engine.configureAndInitShakaPlayer(shakaPlayer);
shakaPlayer.load(src).catch(onError);
shakaPlayer.load(url).catch(onError);

shakaInstance.current = shakaPlayer;
},
Expand Down
1 change: 1 addition & 0 deletions packages/p2p-media-loader-shaka/src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class Engine {
"manifest.dash.ignoreSuggestedPresentationDelay",
true
);
this.player.configure("streaming.useNativeHlsOnSafari", false);
this.updatePlayerEventHandlers("register");
}

Expand Down

0 comments on commit b161b01

Please sign in to comment.