Search code examples
javascriptioschromecast

Getting queue items in Chromecast at receiver end


I am working on chromecast receiver app.

How do I access queue items in current queue?


Solution

  • The Cast queueing APIs allow users to create lists of content items, such as video or audio streams, to play sequentially on the Cast receiver. The queue of content items may be edited, reordered, updated, and so forth. This document describes how to implement an autoplay UI that uses the queueing APIs.

    The Cast Receiver SDK maintains the queue and responds to operations on the queue as long as the queue has at least one item currently active (playing or paused). Senders can join the session and add items to the queue. The receiver maintains a session for queue items until the last item completes playback or the sender stops the playback and terminates the session, or until a sender loads a new queue on the receiver. The receiver does not maintain any information about terminated queues by default. Once the last item in the queue finishes, the media session ends and the queue vanishes.

    MediaQueueItem queueItem = new MediaQueueItem.Builder(mediaInfo)
    .setAutoplay(true)
    .setPreloadTime(20)
    .build();
    

    For more information, check here: https://developers.google.com/cast/docs/autoplay