0

I am using a TextureView with a MediaPlayer to play an mp4 video from a url. Is there any way I can programatically check if the video I am playing has sound?

Edit: I'm using API 14, so I don't have access to the MediaPlayer method getTrackInfo

Many Thanks

Userrrrrrrrr
  • 183
  • 3
  • 12

1 Answers1

5

In API level 16 or later, the MediaPlayer class has a getTrackInfo method that returns a TrackInfo[]. You could then call getTrackType for each element in the array and see if you get MEDIA_TRACK_TYPE_AUDIO.

Michael
  • 57,169
  • 9
  • 80
  • 125