Enqueue multiple media items

做~自己de王妃 提交于 2019-12-11 03:30:08

问题


Can I enqueue multiple tracks to be played on a chromecast receiver app one by one? I just want to play a simple playlist. So i enqueue 5 tracks, my iOS client goes into background mode when playing the second track, and I want my chromecast receiver app to play the remaining 3 tracks. Is this possible?

Actually it's comments to the loadMedia:autoplay: that make me think that this should be possible:

/**
 * Loads, **enqueues (at the end of the queue)**, and optionally starts playback of a new media
 * item.
 *
 * @param mediaInfo An object describing the media item to load.
 * @param autoplay Whether playback should start immediately.
 * @return The request ID, or kGCKInvalidRequestID if the message could not be sent.
 */
- (NSInteger)loadMedia:(GCKMediaInformation *)mediaInfo autoplay:(BOOL)autoplay;

I tried to call this method for two mediaInfo objects, setting autoplay only for the first one, but it still plays only one track.

But other than in comments loadMedia:autoplay: I did not find any indication of this queue, how I can get it, how I can dequeue items, etc. So is this just a wrong comment or does this queue exist somewhere?

P.S. It's not background playback support I am looking for, thanks to this question I know it can not be done, I just want to enqueue multiple items.


回答1:


The comment on that method is wrong and we already have an internal bug on that; it will be fixed in the next release. Back to your question, the current Styled or Default receiver do not have queuing capabilities; you need to roll out your own custom receiver; we have a GitHub sample project that shows how it can be done. We have plans to add such functionality in the future releases but no date is yet announced for that.

Update: Our two receivers now support queueing, along with the Cast SDK. See our documentation for more information.



来源:https://stackoverflow.com/questions/23248833/enqueue-multiple-media-items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!