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 (#39)
  • Loading branch information
enjikaka authored Feb 6, 2024
1 parent 9e23715 commit ec325c5
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 ec325c5

Please sign in to comment.