How to change Audio track in Google Chrome Cast V2

Viewed 821

We are using custom V2 SDk receiver for our Google ChromeCast development.

Our streaming Videos have multiple Audio Tracks to play audio in different languages. I don't see any API details to change Audio track in a different language.

Is there any API in V2 SDk receiver to change Audio track of a video?

I see getAudioTrackManager() available with CAF Reciever SDK but couldn't find anything in V2 SDK.

Any help will be appreciated.

1 Answers

You can trigger a LoadRequest with a new set of activeTrackIds:

var s = cast.framework.CastContext.getInstance().getCurrentSession();
var m = s.getMediaSession().media;
req = new chrome.cast.media.LoadRequest(m);
req.activeTrackIds = [2]; // You can find available tracks in m.tracks
s.loadMedia(req);
Related