Skip to content

Commit

Permalink
Refactor ShakaPlayer initialization from providing the media element …
Browse files Browse the repository at this point in the history
…in the constructor to calling the attach method. Resolves #38
  • Loading branch information
enjikaka committed Feb 5, 2024
1 parent aef02b9 commit fb20b3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/player/src/player/shakaPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ export default class ShakaPlayer extends BasePlayer {
async #createShakaPlayer(mediaEl: HTMLMediaElement) {
this.debugLog('createShakaPlayer', mediaEl);

const player = new shaka.Player(mediaEl);
const player = new shaka.Player();

await player.attach(mediaEl);

registerStalls(mediaEl);
registerAdaptations(player);
Expand Down

0 comments on commit fb20b3b

Please sign in to comment.