1

I want to check if my video contains a sound or not. Based on that I want to add sound enable/disable functionality in my project.

Munir
  • 219
  • 3
  • 11

1 Answers1

2

You can track the current tracks with Player#EventListener#OnTracksChanged and get the current ones with Player#getCurrentTrackGroups(). If you go through the track groups you can look for the type. If you additionally want to check if any of the audio tracks was selected, then Player#getCurrentTrackSelections() is the place to look at.

L.Petrosyan
  • 430
  • 4
  • 12
  • Player#getCurrentTrackGroups() return info about all formats which contains track has audio, video and text etc. – Munir Jan 15 '20 at 08:13