我无法让CAF框架与排队jpeg图像一起使用。我使用SDK v3将QueueItem数组发送到接收器。我希望演员框架逐个显示图像,而不仅仅是一个图像。在我的测试中,输入' loadRequestData'有4张图片。但是投射接收器(在电视上)显示只有一个图像(由queueData.startIndex指向哪个)。 以下是用于初始化队列的javascript代码:
/**
* Initializes the queue.
* @param {!cast.framework.messages.LoadRequestData} loadRequestData
* @return {!cast.framework.messages.QueueData}
* or non-null Promise containing nullable cast.framework.messages.QueueData
* THE loadRequestData (input parameter to initialize) ALREADY CONTAINS 4 ITEMS (jpeg images)
* BUT IT SHOWS **ONLY ONE IMAGE** DEFINED BY queueData.startIndex.
* IT DOES NOT SHOW OTHER IMAGES AT ALL (PLAYBACK DURATION ETC DO NOT SEEM TO HAVE ANY EFFECT)
*/
initialize( loadRequestData) {
const queueData = new cast.framework.messages.QueueData();
const items = [];
for (const requestItem of loadRequestData.queueData.items) {
const item = new cast.framework.messages.QueueItem();
item.media = new cast.framework.messages.MediaInformation();
item.media.contentId = requestItem.media.contentId;
item.media.contentUrl = requestItem.media.contentUrl;
item.media.contentType = requestItem.media.contentType ;
item.media.metadata = requestItem.media.metadata;
item.autoplay = true;
item.playbackDuration = 2;
item.preloadTime = 10;
item.startTime = 0;
items.push(item);
}
queueData.startIndex = 2;
queueData.items = items;
queueData.repeatMode = cast.framework.messages.RepeatMode.REPEAT_ALL;
return queueData;
}