How to check if AVPlayer has Video or just Audio?

后端 未结 4 1702
一向
一向 2021-01-12 09:48

I try to play some \"media\" but at the time the AVPlayer starts I don\'t know if it is audio or Video.

I connected the player Layer and it works fine.



        
4条回答
  •  情话喂你
    2021-01-12 10:38

    I'm not sure but AVPlayerItem has the following array [mPlayerItem.asset.tracks] This contains two objects,one for video and another for audio.Access it as follows [mPlayerItem.asset.tracks objectAtIndex:0] for video and [mPlayerItem.asset.tracks objectAtIndex:1] for audio.

提交回复
热议问题