Search code examples
iosiphonempmovieplayercontrollermpmovieplayer

How can I get current buffer length of MPMoviePlayer


How can I get current buffered length of MpMoviePlayer in seconds? This link described how to get it in bytes, but I need to convert it to seconds.

Is there any way that I can do that?


Solution

  • You can access the playableDuration property of the MPMoviePlayerController.

    According to Apple Docs,

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

    Declaration

       @property(nonatomic, readonly) NSTimeInterval playableDuration
    

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