简体   繁体   English

我可以在AVQueuePlayer中使用replaceCurrentItemWithPlayerItem吗?

[英]Can I use replaceCurrentItemWithPlayerItem with AVQueuePlayer?

I have used replaceCurrentItemWithPlayerItem : with AVPlayer but can it be also used with AVQueuePlayer ? 我已经将replaceCurrentItemWithPlayerItem :与AVPlayer一起使用,但是它也可以与AVQueuePlayer一起AVQueuePlayer吗?

In following apple doc, it is given that: 在下面的苹果文档中,给出了:

This method must only be invoked on player instances created without queues. 此方法只能在不创建队列的播放器实例上调用。 If the player is initialized with multiple items the method throws an exception. 如果播放器使用多个项目初始化,则该方法将引发异常。

What does it means? 这是什么意思? Please guide. 请指导。

If it signifies that it throws exception if we use it with AVQueuePlayer , then I tried using it without any exception but dont know if it is right way to use. 如果它表示如果我们将其与AVQueuePlayer一起使用将引发异常,则我尝试了使用它而没有任何异常,但不知道这是否是正确的使用方式。

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVPlayer_Class/ https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVPlayer_Class/

No you can't, as per Apple docs: 不,根据Apple文档,您不能:

Important 重要

This method is not intended for use with AVQueuePlayer. 此方法不适用于AVQueuePlayer。 If the player is initialized with multiple items this method throws an exception. 如果播放器使用多个项目初始化,则此方法将引发异常。

Here's the link: https://developer.apple.com/reference/avfoundation/avplayer/1390806-replacecurrentitemwithplayeritem?language=objc 这是链接: https : //developer.apple.com/reference/avfoundation/avplayer/1390806-replacecurrentitemwithplayeritem?language=objc

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

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