你如何获得iphone MPMoviePlayer视频的总时间? [英] How do you get an iphone MPMoviePlayer video's total time?

查看:164
本文介绍了你如何获得iphone MPMoviePlayer视频的总时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I just want to figure out how to get a video's total time in seconds. Is there video metadata that loads or something?

推荐答案

MPMoviePlayerController 的属性持续时间(iOS 3.2 +):

MPMoviePlayerController has a property duration (iOS 3.2+):


电影的持续时间,以秒为单位。 (只读)

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

@property(非原子,只读)NSTimeInterval持续时间

@property (nonatomic, readonly) NSTimeInterval duration

如果电影的持续时间如果不知道,此属性中的值为0.0。如果随后确定持续时间,则会更新此属性并发布 MPMovieDurationAvailableNotification 通知。

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 MPMoviePlayer视频的总时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆