iosmpmovieplayercontrollernsnotificationsmpmoviewcontroller

MPMoviePlayerViewController playhead (time) notifications


I'm just wanting to know what the playhead of my movie has changed, but I'm not finding a list of notifications online anywhere (I thought for sure apple would have that info).

Anyway, does anyone know the notification name I should be watching for? I'm sure it's something simple. Thanks.


Solution

  • There is no notification on playback progress or prebuffering progress. Both information are available via simple properties of the MPMoviePlayerController (see its reference) and its implemented protocol MPMediaPlayback (see its reference).

    currentPlaybackTime
    

    The current position of the playhead. (required)

    @property(nonatomic) NSTimeInterval currentPlaybackTime
    

    Discussion

    For video-on-demand or progressively downloaded content, this value is measured in seconds from the beginning of the current item. Changing the value of this property moves the playhead to the new location. For content streamed live from a server, this value represents the time from the beginning of the playlist when it was first loaded.


    playableDuration
    

    The amount of currently playable content. (read-only)

    @property (nonatomic, readonly) NSTimeInterval playableDuration
    

    Discussion

    For progressively downloaded network content, this property reflects the amount of content that can be played now.