2

I am having trouble getting CAF framework to work with queueing jpeg images. I use SDK v3 to send QueueItem array to the receiver. I expect the cast framework to show me the images one by one and not just one image only. In my test, the input 'loadRequestData' has 4 images. But the cast receiver (on TV) shows only one image (whichever is pointed to by queueData.startIndex). Here is the javascript code for initializing the queue:

  /**
    * 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;
    }
Amit Ray
  • 31
  • 2
  • What is the expected behavior/output, and what are you getting instead? It looks like your code sample includes part of your question, you should update your question to include that bit in the question text rather than in the code sample. – AVProgrammer Mar 26 '18 at 18:27
  • Well, I expect the cast framework to show me the images one by one and not just one image only. In my test, the input 'loadRequestData' has 4 images. But the cast receiver (on TV) shows only one image (whichever is pointed to by queueData.startIndex). – Amit Ray Mar 26 '18 at 19:39
  • 2
    I see that standard CAF based receiver will not handle image queues like video and audio files. Now, I've been looking at other options to use the framework for achieving such with image queue. If I use a function (that is called repeatedly with a timer, say), and use something like: function showNextImage(){ loadRequestDataGlobal.queueData.startIndex = localStartIndex++; playerManager.load(loadRequestDataGlobal); } But it loads the whole queue again and there is a period of blank screen. Is there an object which I can use to just advance to the next image in the queue ? – Amit Ray Mar 28 '18 at 10:43
  • Man! I thought it was just me... take a look on my question https://stackoverflow.com/q/49663102/2678719 i'm having the exact same problem... I just need to find a way to skip the current media (in this case the image) – wm1sr Apr 13 '18 at 01:00

0 Answers0