waleed Yousef
waleed Yousef

Reputation: 11

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.

Upvotes: 1

Views: 291

Answers (1)

Kris Markel
Kris Markel

Reputation: 12112

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.

Upvotes: 1

Related Questions