Skip to content

Android Media Queue (PED)#

Media Queue Object Initialization via Seat Pairing#

Initialize the seat pairing service between the passenger’s personal device and the in-flight entertainment (IFE) system. This pairing allows the phone (PED) to interact with the seatback monitor, including managing the media queue.

a. Property Declaration

private SeatRemoteMediaQueueV1 mSeatRemoteMediaQueue;

mSeatRemoteMediaQueue is declared as a property of the class. This object represents the service that manages the media queue between the PED and the IFE system.

b. Seat Pairing Initialization

The following block initializes the seat pairing service, which is necessary for enabling communication between the PED and the seatback monitor

SeatPairingV1.initService(this, new IInFlightCallback() {
    @Override
    public void onInitServiceComplete(Object o, String s) {
        // If the initialization succeeds, cast the returned object into SeatPairingV1
        mSeatPairingV1 = (SeatPairingV1) o;
        if (mSeatPairingV1 != null) { // Check if mSeatPairingV1 is not null before proceeding with pairing-related operations
            // Retrieve the current seat pairing status and set listeners for seat remote controller info, media queue changes, and playback state changes
             mSeatRemoteMediaQueue = mSeatPairingV1.getSeatRemoteMediaQueue();
        }
    }
    @Override
    public void onInitServiceFailed(String s, InFlight.Error error) {
        // Handle initialization failure
    }
}, new InFlight());
  • Step 1: Initialize SeatPairingService: Calls initService on the SeatPairingV1, passing a callback to handle successful initialization.

  • Step 2: Store SeatPairingService Instance: The SeatPairingV1 object is stored in a class-level property called mSeatPairingV1. This allows other parts of the app to interact with the pairing service.

  • Step 3: Retrieve mSeatRemoteMediaQueueremote: mSeatRemoteMediaQueueremote is accessed through the SeatPairingV1, enabling media queue management between the PED and the seatback monitor.

  • Step 4: Media Queue Ready for Actions: With the media queue service initialized, the app can now perform actions like adding, removing, or modifying items in the queue

Step 2: Creating Media Queue (Playlist) Items#

When building a playlist or media queue, there are multiple ways to create items based on the needs of your application. The following are three methods you can use to generate media queue request items, depending on the available parameters and requirements. Each method allows you to customize and structure the media queue accordingly.

1. MediaQueueRequestItem(String mediaUri)

This constructor creates a new MediaQueueRequestItem object with the provided media URI.

This constructor is useful for creating a media queue request item with the specified URI, which can then be used to load or launch media in the queue.

2. MediaQueueRequestItem(String globalUri, String mediaUri, String soundTrack, String subtitle, JSONObject extras)

This constructor creates a new MediaQueueRequestItem object with detailed information about a media item.

Parameters:

  • String globalUri: The global URI of the media item.

  • String mediaUri: The URI of the specific media item to be added to the media queue.

  • String soundTrack: The soundtrack associated with the media item.

  • String subtitle: The subtitle associated with the media item.

  • JSONObject extras: A JSONObject containing any additional information such as source eg. playlist or album

This constructor is useful for creating a media queue request item with comprehensive details, which can then be used to load or launch media in the queue with specific configurations and additional information.

3. MediaQueueRequestItem(String globalUri, String mediaUri, String soundtrack, String subtitle, SeatBookmarkV1.Bookmark bookmark, JSONObject extras)

This constructor creates a new MediaQueueRequestItem object with detailed information about a media item.

Parameters:

  • String globalUri: The global URI of the media item.

  • String mediaUri: The URI of the specific media item to be added to the media queue.

  • String soundtrack: The soundtrack associated with the media item.

  • String subtitle: The subtitle associated with the media item.

  • SeatBookmarkV1.Bookmark bookmark: A bookmark object containing the media URI , elapsed time ,subtitle ,soundtrack of the current item.

  • JSONObject extras: A JSONObject containing any additional information such as source eg. playlist or album

This constructor is useful for creating a media queue request item with comprehensive details, including a bookmark for resuming playback from a specific point, and any additional metadata needed for the media item.

Note: When including a bookmark in the payload for the load or launch queue API, priority is assigned to the items within the bookmark. For example, if the bookmarked media contains a soundtrack or subtitle labeled as "eng", it will take precedence over any soundtrack or subtitle options sent separately.

Step 3: Launch/Load Media queue Api#

The "Launch" and "Load" media APIs facilitate the transmission of media content from a personal electronic device (PED) to the seatback monitor, typically through a pairing mechanism. This allows passengers to select and play their desired playlist on the seatback monitor for an enhanced entertainment experience during their journey.

In the context described, these APIs provide developers with the means to control the media queue, which dictates the sequence of media content to be played. When using the "Launch" API, new media items are appended to the existing queue, allowing for seamless addition of content without interrupting playback. On the other hand, the "Load" API clears the current queue and replaces it entirely with a new set of media items. This distinction is crucial depending on whether you want to add to an existing playlist or start afresh with a new one.

Launch/Load Media queue Api

1. launchMedia(List items, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener)

This method launches media playback using a list of media queue request items.

mSeatRemoteMediaQueue.launchMedia(items, new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess(JSONObject response) {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • List<MediaQueueRequestItem> items: A list of MediaQueueRequestItem objects representing the media items to be queued and played.
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener: A listener interface to handle events and updates related to the media queue launch command.
  • Returns: A boolean value indicating whether the media launch was successful (true) or not (false).

2. loadMediaQueue(List mediaUri, int startIndex, SeatRemoteMediaQueueV1.RepeatModeType repeatMode, boolean autoPlay,SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener)

mSeatRemoteMediaQueue.loadMediaQueue(items, 0,
    SeatRemoteMediaQueueV1.RepeatModeType.NONE,
    true, new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess(JSONObject response) {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • List<MediaQueueRequestItem> mediaUri: A list of MediaQueueRequestItem objects representing the media items to be queued.
    • int startIndex: The index of the media item from which playback should start.
    • SeatRemoteMediaQueueV1.RepeatModeType repeatMode: The repeat mode to be applied to the media queue (e.g.,NONE, ONE, ALL).
    • boolean autoPlay: A boolean indicating whether playback should start automatically (true) or not (false).
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener: A listener interface to handle events and updates related to loading the media queue.
  • Returns: A boolean value indicating whether the media queue was successfully loaded (true) or not (false).

Methods to modify Media Queue#

The following methods allow you to manage media queue items in an in-flight entertainment (IFE) system. Whether you need to add, remove, or clear items from the queue, each method provides a flexible way to interact with the media playback on a seatback monitor. Items in the media queue are represented as dictionaries that include various details such as media URIs, soundtracks, subtitles, and other attributes. Completion blocks are used to handle the results of these operations, ensuring that you can track success or handle any errors.

1. addItems(List mediaItems, int index, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener)

This method adds a list of media items to the remote media queue at the specified index.

mSeatRemoteMediaQueue.addItems(items, idx, new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess(JSONObject response) {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • List<MediaQueueRequestItem> mediaItems: A list of MediaQueueRequestItem objects representing the media items to be added to the queue.
    • int index: The position in the queue where the media items should be inserted.Set index to -1 to add item to the end of queue
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener: A listener interface to handle events and updates related to adding items to the queue.
  • Returns: A boolean value indicating whether the media items were successfully added to the queue (true) or not (false).

2. removeItems(List items, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener)

This method removes specified media items from the remote media queue.

mSeatRemoteMediaQueue.removeItems(new ArrayList<String>(Arrays.asList(items)),
  new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess(JSONObject response) {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • List<String> items: A list of strings representing the identifiers (such as URIs) of the media items to be removed from the queue.
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener: A listener interface to handle events and updates related to the removal of items from the queue.
  • Returns: A boolean value indicating whether the media items were successfully removed from the queue (true) or not (false).

3. removeItemAtIndex(int index, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener)

This method removes a media item from the remote media queue at the specified index.

mSeatRemoteMediaQueue.removeItemAtIndex(index, new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess(JSONObject jsonObject) {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • int index: The index of the media item to be removed from the queue.
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener: A listener interface to handle events and updates related to the removal of the item from the queue.
  • Returns: A boolean value indicating whether the media item was successfully removed from the queue (true) or not (false).

4. emptyQueue(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener)

This method clears all media items from the remote media queue.

mSeatRemoteMediaQueue.emptyQueue(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess(JSONObject jsonObject) {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueUpdateCommandListener listener: A listener interface to handle events and updates related to clearing the media queue.
  • Returns: A boolean value indicating whether the media queue was successfully cleared (true) or not (false).

Media Control Operations#

1. play(String contentType, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method starts playing media of a specified content type from the remote media queue.

mSeatRemoteMediaQueue.play(contenttype, new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • contentType: A String that specifies the type of content to be played (e.g., "track", "movie").
    • listener: An object that implements the SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener interface to handle playback events.
  • Returns:

    • boolean: true if the playback starts successfully; false otherwise.

2. play(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method resumes media playback from a remote media queue.

mSeatRemoteMediaQueue.play(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle playback events and updates.
  • Returns: A boolean value indicating whether the playback was successfully resumed.

3. pause(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method pauses the media playback that is currently playing from the remote media queue.

mSeatRemoteMediaQueue.pause(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to the pause action.
  • Returns: A boolean value indicating whether the playback was successfully paused.

4. stop(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method stops the media playback that is currently playing from the remote media queue.

mSeatRemoteMediaQueue.stop(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
        // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
        // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to the stop action.
  • Returns: A boolean value indicating whether the playback was successfully stopped.

Media Playback Settings#

1. jumpToIndex(int index, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method jumps to the media item located at the specified index in the remote media queue and begins playback from there.

mSeatRemoteMediaQueue.jumpToIndex(index, new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
        // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
         //Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:
    • int index: The index of the media item in the queue to which playback should jump.
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to the jump action.
  • Returns: A boolean value indicating whether the jump to the specified index was successful.

2 . jumpToNext(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method jumps to the next media item in the remote media queue and begins playback from there.

mSeatRemoteMediaQueue.jumpToNext(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:
  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to the jump action.

  • Returns: A boolean value indicating whether the jump to the next item was successful.

3. jumpToPrev(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method jumps to the previous media item in the remote media queue and begins playback from there.

mSeatRemoteMediaQueue.jumpToPrev(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to the jump action.
  • Returns: A boolean value indicating whether the jump to the previous item was successful.

4. setRepeatMode(SeatRemoteMediaQueueV1.RepeatModeType type, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method sets the repeat mode for the media queue. The repeat mode determines whether and how items in the queue should be repeated during playback.

  • The repeat mode in a media player dictates how playback behaves upon reaching the end of a playlist or track.

  • When set to "Repeat All," the player continually cycles through the entire playlist, starting anew once the last track is reached. It endlessly loops through all tracks in the playlist until manually halted.

  • In "Repeat One" mode, the player repeatedly plays the current track. After completing playback, it automatically restarts from the beginning of the same track, creating a loop specifically for that track.

  • Alternatively, in "None" mode, playback halts upon reaching the end of the playlist or track. There is no automatic repetition or looping, requiring manual intervention to initiate playback again.

  • When the shuffle mode is activated, the next index to be played is communicated by a seat service (a core application in the interactive system) to the interactive interface using the "onMediaQueueCurrentIndexChanged" event.

mSeatRemoteMediaQueue.setRepeatMode(SeatRemoteMediaQueueV1.RepeatModeType.ALL, new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • SeatRemoteMediaQueueV1.RepeatModeType type: The repeat mode to be set for the media queue. This is likely an enumeration defining the repeat modes (e.g., none repeat, repeat one, repeat all).
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to setting the repeat mode.
  • Returns: A boolean value indicating whether the repeat mode was successfully set (true) or not (false).

5. setShuffleMode(boolean mode, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method sets the shuffle mode for the media queue.

  • Even if shuffle mode is activated, the media queue items on both the seatback (interactive) and the PED will remain unchanged (not shuffled). The shuffling logic is managed by a seat service, which communicates the index to be played to both the seatback (interactive) and the PED

  • The seatback (interactive) system should not generate its own shuffled list.

  • To ensure seamless operation of the shuffle logic, the jumpToNext() and jumpToPrev() functions need to be invoked when the next and previous buttons are pressed on the media player.

  • The jumpToIndex() function should only be called when the user is playing the media randomly.

mSeatRemoteMediaQueue.setShuffleMode(true, new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • boolean mode: A boolean value indicating whether shuffle mode should be enabled (true) or disabled (false).
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to setting the shuffle mode.
  • Returns: A boolean value indicating whether the shuffle mode was successfully set (true) or not (false).

6. setSoundtrackCode(String langCode, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method sets the default soundtrack language code for the media queue.

mSeatRemoteMediaQueue.setSoundtrackCode("eng", new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • String langCode: The language code of the soundtrack to be set as the default.
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to setting the default soundtrack code.
  • Returns: A boolean value indicating whether the default soundtrack code was successfully set (true) or not (false).

7. setSubtitleCode(String subtitleCode, SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener)

This method sets the default subtitle code for the remote media queue.

 mSeatRemoteMediaQueue.setSubtitleCode("eng", new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener() {
    @Override
    public void onSeatRemoteMediaQueueCommandSendSuccess() {
    // Invoked once SeatRemoteMediaQueueController service successfully sends the message to paired seatback monitor.
    }

    @Override
    public void onSeatRemoteMediaQueueCommandSendError(Error error) {
    // Invoked once SeatRemoteMediaQueueController service run into error, and an SeatMediaRemoteController.Error will be provided .
    }
});
  • Parameters:

    • String langCode: The language code of the subtitles to be set as the default.
    • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueListener listener: A listener interface to handle events and updates related to setting the default subtitle code.
  • Returns: A boolean value indicating whether the default subtitle code was successfully set (true) or not (false).

Media Queue Details#

The following properties and methods provide information about and control over the media queue. These can be used to retrieve various details such as language settings, playback modes, item existence, and more.

1. hasPrev()

This method checks if there is a previous item in the media queue that can be jumped to.

mSeatRemoteMediaQueue.hasPrev();
  • Returns: A boolean value indicating whether there is a previous item in the media queue. If true, it means there is a previous item; if false, it means there isn't.

2. hasNext()

This method checks if there is a next item in the media queue that can be jumped to.

mSeatRemoteMediaQueue.hasNext();
  • Returns: A boolean value indicating whether there is a next item in the media queue. If true, it means there is a next item; if false, it means there isn't.

3. getSubtitleCode()

This method returns the code of the currently selected subtitle track.

mSeatRemoteMediaQueue.getSubtitleCode();
  • Returns: A String representing the subtitle code.

4. getSoundtrack()

This method returns the code of the currently selected soundtrack.

mSeatRemoteMediaQueue.getSoundtrack();
  • Returns: A String representing the soundtrack code.

5. getRepeatMode()

This method returns the current repeat mode of the media queue.

mSeatRemoteMediaQueue.getRepeatMode();
  • Returns: An instance of SeatRemoteMediaQueueV1.RepeatModeType representing the repeat mode.

6. getShuffleMode()

This method returns the current shuffle mode of the media queue.

mSeatRemoteMediaQueue.getShuffleMode();
  • Returns: A boolean value indicating whether shuffle mode is enabled (true) or disabled (false).

7. getCurrentIndex()

This method returns the index of the current media item in the media queue.

mSeatRemoteMediaQueue.getCurrentIndex();
  • Returns: An integer representing the index of the currently playing media item.

8. getLastUpdated()

This method returns the timestamp of the last update made to the media queue.

mSeatRemoteMediaQueue.getLastUpdated();
  • Returns: A long value representing the timestamp of the last update.

9. getQueueItemCount()

This method returns the total number of items currently in the remote media queue.

mSeatRemoteMediaQueue.getQueueItemCount();
  • Returns: An integer representing the count of media items in the queue.

10. isActive()

This method returns the current status of the remote media queue, indicating whether it is active or inactive.

mSeatRemoteMediaQueue.isActive();
  • Returns: A boolean value where true indicates that the remote media queue is active, and false indicates that it is inactive.

11. getPlaybackState()

This method returns the current playback state of the media queue.

mSeatRemoteMediaQueue.getPlaybackState();
  • Returns: An instance of SeatRemoteMediaQueueV1.PlaybackState represents the current playback state.

12. getItems()

This method returns a list of all the media items currently in the remote media queue.

mSeatRemoteMediaQueue.getItems();
  • Returns: An ArrayList of MediaQueueItem objects, where each MediaQueueItem represents an individual media item in the queue.

13. getCurrentQueueItem()

This method returns the media item that is currently playing from the remote media queue.

mSeatRemoteMediaQueue.getCurrentQueueItem();
  • Returns: A MediaQueueItem object representing the current media item.

14. createBookmark()

This method creates and returns a Bookmark object that contains the media URI and the elapsed time of the current item in the media queue. Passengers can save bookmarks on a paired device and then remotely resume playback on a seatback from the saved position.

// Create a bookmark for the current media item
    SeatBookmarkV1.Bookmark bookmark = mSeatRemoteMediaQueue.createBookmark();
// Save the bookmark at some path eg. relative path within your application's directory structure
    bookmark.saveBookmark(path);
  • Returns: A SeatBookmarkV1.Bookmark object containing:

  • Media URI: The URI of the current media item.

  • Elapsed Time: The playback position or elapsed time of the current media item.

Listeners/Notifications#

1. setRemoteMediaQueueActiveStatusChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueActiveStatusChangeListener listener)

This method sets a listener to receive notifications about changes in the active status of the remote media queue.

mSeatRemoteMediaQueue.setRemoteMediaQueueActiveStatusChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueActiveStatusChangeListener() {
        @Override
        public void onSeatRemoteMediaQueueActiveStatusChanged(boolean b) {
            // Invoked once SeatRemoteMedia service successfully receives remote media queue active status change from remote seatback.
        }
    });

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueActiveStatusChangeListener listener: A listener interface to handle events related to changes in the active status of the remote media queue.

2. setRemoteMediaQueueHasNextPrevChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueHasNextPrevChangeListener listener)

This method sets a listener to receive notifications about changes in the availability of next and previous items in the remote media queue.

mSeatRemoteMediaQueue.setRemoteMediaQueueHasNextPrevChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueHasNextPrevChangeListener() {
        @Override
        public void onSeatRemoteMediaQueueHasNextPrevChanged(boolean hasNext, boolean hasPrev) {
            // Invoked once SeatRemoteMedia service successfully receives media queue play index changed from remote seatback monitor.
        }
    });

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueHasNextPrevChangeListener listener: A listener interface to handle events related to changes in the availability of next and previous items in the remote media queue.

3. setRemoteMediaQueueRepeatModeChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueRepeatModeChangeListener listener)

This method sets a listener to receive notifications about changes in the repeat mode of the remote media queue.

mSeatRemoteMediaQueue.setRemoteMediaQueueRepeatModeChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueRepeatModeChangeListener() {
    @Override
    public void onSeatRemoteMediaQueueRepeatModeChanged(SeatRemoteMediaQueueV1.RepeatModeType mode) {

    }
});

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueRepeatModeChangeListener listener: A listener interface to handle events related to changes in the repeat mode of the remote media queue.

4. setRemoteMediaQueueShuffleModeChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueShuffleModeChangeListener listener)

This method sets a listener to receive notifications about changes in the shuffle mode of the remote media queue.

mSeatRemoteMediaQueue.setRemoteMediaQueueShuffleModeChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueShuffleModeChangeListener() {
        @Override
        public void onSeatRemoteMediaQueueShuffleModeChanged(boolean mode) {

        }
    });

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueShuffleModeChangeListener listener: A listener interface to handle events related to changes in the shuffle mode of the remote media queue.

5. setRemoteMediaQueueSoundtrackChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueSoundtrackChangeListener listener)

This method sets a listener to receive notifications about changes in the soundtrack of the remote media queue.

mSeatRemoteMediaQueue.setRemoteMediaQueueSoundtrackChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueSoundtrackChangeListener() {
    @Override
    public void onSeatRemoteMediaQueueSoundtrackChanged(String code) {

    }
});

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueSoundtrackChangeListener listener: A listener interface to handle events related to changes in the soundtrack of the remote media queue.

6. setRemoteMediaQueueSubtitleChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueSubtitleChangeListener listener)

This method sets a listener to receive notifications about changes in the subtitle settings of the remote media queue.

mSeatRemoteMediaQueue.setRemoteMediaQueueSubtitleChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueSubtitleChangeListener() {
    @Override
    public void onSeatRemoteMediaQueueSubtitleChanged(String code) {

    }
});

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueSubtitleChangeListener listener: A listener interface to handle events related to changes in the subtitle settings of the remote media queue.

7. setSeatRemoteMediaQueueChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueChangeListener listener)

This method sets a listener to receive notifications about changes in the remote media queue.

mSeatRemoteMediaQueue.setSeatRemoteMediaQueueChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueChangeListener() {
    @Override
    public void onSeatRemoteMediaQueueChanged() {

    }
});

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueChangeListener listener: A listener interface to handle events related to changes in the remote media queue.

8. setSeatRemoteMediaQueueIndexChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueueIndexChangeListener listener)

This method sets a listener to receive notifications about changes in the index of media items within the remote media queue.

mSeatRemoteMediaQueue.setSeatRemoteMediaQueueIndexChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueueIndexChangeListener() {
    @Override
    public void onSeatRemoteMediaQueueIndexChanged(int index) {

    }
});

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueueIndexChangeListener listener: A listener interface to handle events related to changes in the index of media items within the remote media queue.

9. setSeatRemoteMediaQueuePlaybackEndedListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueuePlaybackEndedListener listener)

This method sets a listener to receive notifications when the playback of the media queue ends.

queueV1.setSeatRemoteMediaQueuePlaybackEndedListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueuePlaybackEndedListener() {
        @Override
        public void onSeatRemoteMediaQueuePlaybackEnded(String item) {
            // the queue ID of the item which ended
        }
    });

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueuePlaybackEndedListener listener: A listener interface to handle events related to the end of playback in the media queue.

10. setSeatRemoteMediaQueuePlaybackStateChangeListener(SeatRemoteMediaQueueV1.SeatRemoteMediaQueuePlaybackStateChangeListener listener)

This method sets a listener to receive notifications about changes in the playback state of the remote media queue.

mSeatRemoteMediaQueue.setSeatRemoteMediaQueuePlaybackStateChangeListener(new SeatRemoteMediaQueueV1.SeatRemoteMediaQueuePlaybackStateChangeListener() {
    @Override
    public void onSeatRemoteMediaQueuePlaybackStateChanged(SeatRemoteMediaQueueV1.PlaybackState state) {

    }
});

Parameters:

  • SeatRemoteMediaQueueV1.SeatRemoteMediaQueuePlaybackStateChangeListener listener: A listener interface to handle events related to changes in the playback state of the remote media queue.

Version 1.0