开发者

AVPlayerStatus?

开发者 https://www.devze.com 2023-02-20 07:59 出处:网络
So I\'m having trouble reading how I sho开发者_如何学运维uld use the AVPlayerStatus property I have made the @property(nonatomic, readonly) AVPlayerStatus *status; as the documentation tells me, but

So I'm having trouble reading how I sho开发者_如何学运维uld use the AVPlayerStatus property

I have made the @property(nonatomic, readonly) AVPlayerStatus *status; as the documentation tells me, but cant seem to find out how i use the

AVPlayerStatusUnknows..

I wanna use it in something like this

while(AVPlayerStatusUnknows)
{ 
      //DO SOMETHING 
} 

can anyone help me here ?

thanks


@Patrick you cannot use the AVPlayerStatus objects because its not a class or a structure (or Union). Its an enumerator. we use it for checking a condition where in switch mostly (if we are creating it). The above method suggested by @Amorya is how to use AVPlayerStatus.

Hope this is making sense to you.

Check the documentation.

http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVPlayer_Class/Reference/Reference.html

Edit:

what you are looking for is something like this. I don't think that this will work or it might. but you will get the basic idea.

[yourActivityIndicator startAnimation];
while(yourAVPlayer.status == AVPlayerStatusUnknown) {}
[yourActivityIndicator stopAnimation];

or if you just call the last 2 lines in a custom queue using GCD it will show you what you are looking for.

something like this, (not sure if this the exact syntax )

[yourActivityIndicator startAnimation];

dispatch_queue(^{
       while(yourAVPlayer.status == AVPlayerStatusUnknown) {}
       [yourActivityIndicator stopAnimation];
 });


You don't need to make that property yourself: it's a property on an AVPlayer object.

You should be able to do while (yourAVPlayer.status == AVPlayerStatusUnknown) {}. Substitute yourAVPlayer with an object of class AVPlayer.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号