chore: Remove state engine (#5752)

The state engine mechanism, designed for the player class, was
over-engineered. The structure of the class makes debugging player
errors unnecessarily annoying, by obfuscating the code-path the error
followed, and in general
has created a significant amount of technical debt.
This changes the player to use an async-await setup for the top-level
operations, laying things out much more cleanly
and linearly.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
This commit is contained in:
theodab
2023-10-30 23:59:08 -07:00
committed by GitHub
parent c457db835f
commit 4425dca283
43 changed files with 907 additions and 2836 deletions
+2 -1
View File
@@ -52,7 +52,8 @@ function initApp() {
async function initPlayer() {
// Create a Player instance.
const video = document.getElementById('video');
const player = new shaka.Player(video);
const player = new shaka.Player();
async player.attach(video);
// Attach player to the window to make it easy to access in the JS console.
window.player = player;