简体   繁体   English

如何从MPMoviePlayerController获取MPMediaItem?

[英]How to get a MPMediaItem from MPMoviePlayerController?

How can i get MPMediaItem from MPMoviePlayerController as i can get it in case of MusicPlayer as follows 我如何从MPMoviePlayerController获取MPMediaItem,因为在MusicPlayer的情况下可以获取它,如下所示

MPMediaItem *currentItem = self.musicPlayer.nowPlayingItem;

But how to get it from MPMoviePlayerController? 但是如何从MPMoviePlayerController获得它呢? Is it even possible? 可能吗

Infact i want to get the information about the current movie item playing, for example its title, artist etc, is it possible to get the metadata for a video file? 实际上,我想获取有关当前播放的电影项目的信息,例如其标题,艺术家等,是否可以获取视频文件的元数据?

I don't know if you finaly find out a solution, but I do this way and it works great : 我不知道您是否最终找到解决方案,但是我这样做,效果很好:

MPMediaItem *nowPlayingMediaItem = [myPlayer nowPlayingItem];

You can only call accessors and mutators using the "dot-syntaxe". 您只能使用“点语法”来调用访问器和变异器。 For other methods you must use Obejctive-C "message-style-syntaxe". 对于其他方法,必须使用Obejctive-C“消息样式语法”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM