UIActivity Indicator with mediaplayer framework
i am playing video from URL, i need to display the activity indicator while my movie is loading and if also was buffering at any time.开发者_如何转开发
Assuming that you're using MPMoviePlayerController, you can register for MPMoviePlayerLoadStateDidChangeNotification and react to changes in the loadState property.
Specifically, you'll want to display the activity indicator until the loadState changes to MPMovieLoadStatePlayable, and then display it again if it changes to MPMovieLoadStateStalled, and turn it off once more when the state is MPMovieLoadStatePlayable or MPMovieLoadStatePlaythroughOK.
精彩评论