iphone - 你如何获得 iphone MPMoviePlayer 视频的总时间?

标签 iphone video mpmovieplayercontroller duration

我只想弄清楚如何以秒为单位获取视频的总时间。是否有加载的视频元数据之类的?

最佳答案

MPMoviePlayerController 有一个属性duration (iOS 3.2+):

The duration of the movie, measured in seconds. (read-only)

@property (nonatomic, readonly) NSTimeInterval duration

If the duration of the movie is not known, the value in this property is 0.0. If the duration is subsequently determined, this property is updated and a MPMovieDurationAvailableNotification notification is posted.

关于iphone - 你如何获得 iphone MPMoviePlayer 视频的总时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1214958/

相关文章:

iphone - 如何让 Sprite 在点击时随着各种动画消失?

ios - Cordova iOS 视频标签本地文件源

video - 将 H.264 媒体文件转换为 mp4

ios - MPMoviePlayerController 正在播放 YouTube 视频吗?

iphone - 使用 AVFoundation 更改视频帧大小

ios - 如何使用 Accelerate Framework 将带有 mask 的图像组合成一个 UIImage?

ios - MPNowPlayingInfoCenter 和 MPRemoteCommandCenter 在模拟器中工作,但在设备上不起作用

Html 视频播放器播放声音但不播放视频

ios - MPMoviePlayerController 显示黑屏

ios4 - 多个MPMoviePlayerController实例