Skip to content

Instantly share code, notes, and snippets.

@PatrickKalkman
Created May 14, 2021 18:52
Show Gist options
  • Save PatrickKalkman/a27c0115aaaeced53b335e9f5db9c4f5 to your computer and use it in GitHub Desktop.
Save PatrickKalkman/a27c0115aaaeced53b335e9f5db9c4f5 to your computer and use it in GitHub Desktop.
function to initialize shaka-player
private initPlayer() {
this.player = new shaka.Player(this.videoElement);
const ui = new shaka.ui.Overlay(
this.player,
this.videoContainerElement,
this.videoElement
);
this.player
.load('http://www.bok.net/dash/tears_of_steel/cleartext/stream.mpd')
.then(() => {
this.videoElement?.play();
})
.catch((e: any) => {
console.error(e);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment