Created
May 14, 2021 18:52
-
-
Save PatrickKalkman/a27c0115aaaeced53b335e9f5db9c4f5 to your computer and use it in GitHub Desktop.
function to initialize shaka-player
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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