Reputation: 11
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
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