Start playback, start without sound #4598
Unanswered
Zuldek1994822
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
New, I'm trying. Everything works, but I wanted to clarify...
If the first attempt to start playback failed, the listener is triggered in which we start again but without sound.
My request is simple and banal. Is it possible to write this code easier? It’s confusing that the same code is written twice, something like this:
We launch it, in case of failure we set the mute and launch it again. Repeatedly without specifying any links or the object with the video.
Second question:
this.dsh.on(dashjs.MediaPlayer.events.PLAYBACK_STARTED, _ => this.add_h());
It is necessary to add a header to the player, but do this when it is known that the video plays with or without sound.
You can add a header right away, but if it doesn’t work the first time, I add a class to the player. To show the sound button in place of the header.
In cases where it was not possible to launch with sound, the header is first added, then it is forced to hide it.
As it is now done, the header appears with a delay if you manage to start the player the first time.
Beta Was this translation helpful? Give feedback.
All reactions