My asset has 2 audio streams: english and hungarian. Sometimes hungarian is the second audio stream, not the first, therefore not the default.
I want to always start playback with hungarian audio. I based my code from Cast-Player-Sample.
Attempt:
After this.onMetadataLoadedOrig_(info);
(here) I did:
this.protocol.enableStream(2, true); //enables hungarian
this.protocol.enableStream(1, false);
this.player_.reload();
It doesn't work: player goes to IDLE state and nothing is played.
BTW, protocol
comes from this.protocol = protocolFunc(host)
(here)
The only way I could make it work was to start with the default language and change it only after player is in PLAYING state.
How can I start playback with audio other than default (first)?