I’m loading different videos from URL and play them in the Unity VideoPlayer component. Is there any way to detect whether the video has an audio track (or multiple) or not?
Use case: would like to show audio icon to user only if the video has audio.
I tried .audioTrackCount and .controlledAudioTrackCount. audioTrackCount always returns 0, controlledAudioTrackCount always returns 1. I wait till isPrepared = true before I check the counts.
Also if I check the VideoPlayer component in the Inspector Controlled Tracks shows 1 - even for videos without any audio tracks.
I’m generally more the audio guy, but I gather that sometimes metadata is not completely available just after Prepare(). You might have to start the video for everything to be set right. Do you still get this if you hook your check to the videoPlayer.started callback?