Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions packages/core/src/tech/ShakaTech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class DashPlayer extends BaseTech {
constructor(opts: IWebPlayerOptions) {
super(opts);
shaka.polyfill.installAll();
this.shakaPlayer = new shaka.Player(this.video);
this.shakaPlayer = new shaka.Player();

const restrictToElementSize = !opts.disablePlayerSizeLevelCap;
this.shakaPlayer.configure({ abr: { restrictToElementSize: restrictToElementSize } });
Expand All @@ -28,12 +28,15 @@ export default class DashPlayer extends BaseTech {
);
}

load(src: string): Promise<void> {
async load(src: string): Promise<void> {
super.setDefaultState();
return this.shakaPlayer.load(src).catch((error) => {
try {
await this.shakaPlayer.attach(this.video);
await this.shakaPlayer.load(src);
} catch (error) {
this.handleLoadError(error);
throw error;
});
}
}

private handleLoadError(error: any): void {
Expand Down
Loading