3

I found that we can add mediaTracks for external audio and subtitles. And activate it with setActiveTrackIDs.

But how I can change current audio track from english to different language? Any code example? Infuse player in store somehow can do this.

Edit

One idea is to change default audio track in media file and reload from Chromecast. Dig little inside ffmpeg, understand this not easy if you not have experience.

The other idea is to retrieve audio stream data from video, and provide it with custom media server. This is also not trivial.

Third idea is AirConnect, but it works only with audio. Dig into VLC player code, found that there something similar implemented on low level programming.

Gralex
  • 4,285
  • 7
  • 26
  • 47
  • Set the tracks with: https://developers.google.com/android/reference/com/google/android/gms/cast/framework/media/RemoteMediaClient#setActiveMediaTracks(long[]) Get the active tracks with: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaStatus.html#getActiveTrackIds() – Anjaneesh Rayapati Jul 29 '19 at 20:36
  • @AnjaneeshRayapati and how I can set other language for audio track in `mkv` file. Audio track contains in video. I want to switch between – Gralex Jul 29 '19 at 20:47
  • You'll need parsing of your mkv file in order to extract its tracks, please check https://stackoverflow.com/questions/9785474/iphone-mkv-mka-parsing-libraries – Pavel Kozlov Aug 05 '19 at 21:02
  • For Audio tracks : https://developers.google.com/cast/docs/caf_receiver/tracks#audio-tracks – Anjaneesh Rayapati Aug 06 '19 at 20:02

1 Answers1

0

The Chromecast doesn't support audio tracks on MKV. You would have to switch them on the sender's end.

casolorz
  • 8,486
  • 19
  • 93
  • 200