Class MediaQueue
- java.lang.Object
-
- aero.panasonic.inflight.services.pairing.v1.MediaQueue
-
public class MediaQueue extends java.lang.ObjectThe MediaQueue class allows developers to manipulate the media queue in the seatback monitor.
For example, modify the queue by adding, removing, loading or clearing items and change the queue status by playing, pausing or stopping the item. In addition, the APIs get the queue status and set listener for queue updates.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMediaQueue.ErrorError messages.static interfaceMediaQueue.GetMediaQueueItemsListenerstatic interfaceMediaQueue.Listenerstatic interfaceMediaQueue.MediaQueueChangeListenerstatic interfaceMediaQueue.MediaQueueHasNextPrevChangeListenerstatic interfaceMediaQueue.MediaQueueIndexChangeListenerstatic interfaceMediaQueue.MediaQueueItemsAddedListenerstatic interfaceMediaQueue.MediaQueueItemsClearedListenerstatic interfaceMediaQueue.MediaQueueItemsRemovedListenerstatic interfaceMediaQueue.MediaQueuePlaybackStateChangeListenerstatic interfaceMediaQueue.MediaQueueRepeatModeChangeListenerstatic interfaceMediaQueue.MediaQueueShuffleModeChangeListenerstatic interfaceMediaQueue.MediaQueueSoundtrackChangeListenerstatic interfaceMediaQueue.MediaQueueSubtitleChangeListenerstatic classMediaQueue.PlaybackStateThe states for the playback.static classMediaQueue.RepeatModeTypeThe types of repeat modes.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaddItems(java.util.List<MediaQueueRequestItem> mediaItems, MediaQueue.MediaQueueItemsAddedListener listener)Adds items to the end of the media queue.booleanclearQueue(MediaQueue.MediaQueueItemsClearedListener listener)Removes the items from the media Queue.intgetCurrentQueueItemIndex()Gets the index position for the current media item.voidgetItems(PagingOption pagingOption, MediaQueue.GetMediaQueueItemsListener listener)Gets an array of media queue items.longgetLastUpdated()Gets the last timestamp for the media queue.MediaQueue.PlaybackStategetPlaybackState()Gets the playback state of the queue.intgetQueueItemCount()Gets the count for the number of media items in the queue.MediaQueue.RepeatModeTypegetRepeatMode()Gets the repeat mode for the media queue.booleangetShuffleMode()Returns the shuffle mode.java.lang.StringgetSoundtrackCode()Gets the default ISO 639-2 language code for the soundtracks in the media queue.java.lang.StringgetSoundtrackType()Gets the default soundtrack type of the media queue.java.lang.StringgetSubtitleCode()Gets the default ISO 639-2 language code for the subtitles in the media queue.java.lang.StringgetSubtitleType()Gets the defaults subtitle type of the media queue.booleanhasNext()Gets whether the media queue has a next item.booleanhasPrev()Gets whether the media queue has a previous item.booleaninsertItems(java.util.List<MediaQueueRequestItem> mediaItems, int position, MediaQueue.MediaQueueItemsAddedListener listener)Adds items to the specified position.booleanjumpTo(java.lang.String queueId)Jumps to media item with the specified ID in the queue.booleanjumpToNext()Jumps to next item in the media queue.booleanjumpToPrev()Jumps to previous item in the media queue.booleanloadMediaQueue(java.util.List<MediaQueueRequestItem> items, int startIndex, MediaQueue.RepeatModeType repeatMode, boolean autoPlay, MediaQueue.MediaQueueItemsAddedListener listener)Clears existing items and loads new items to the media queue.booleanpause()Pauses the playing of the media item in the queue.booleanplay()Starts or continues playback of the current item in the media queue.booleanplay(java.lang.String contentType)Plays the media item with the specified content type.booleanremoveItems(java.util.List<java.lang.String> queueIds, MediaQueue.MediaQueueItemsRemovedListener listener)Removes items from the media queue.booleansetDefaultSoundtrack(java.lang.String code, java.lang.String type)Sets the default ISO 639-2 language code and type for the soundtrack in the media queue.booleansetDefaultSoundtrackCode(java.lang.String code)Deprecated.Sets the default ISO 639-2 language code for the soundtracks in the media queue.booleansetDefaultSubtitle(java.lang.String code, java.lang.String type)Sets the default ISO 639-2 language code for the subtitles in the media queue.booleansetDefaultSubtitleCode(java.lang.String code)Deprecated.Sets the default ISO 639-2 language code for the subtitles in the media queue.voidsetMediaQueueChangeListener(MediaQueue.MediaQueueChangeListener listener)Sets the Media Queue change listener.voidsetMediaQueueCurrentIndexChangeListener(MediaQueue.MediaQueueIndexChangeListener listener)Sets the Media Queue Item Index change listener.voidsetMediaQueueHasNextPrevChangeListener(MediaQueue.MediaQueueHasNextPrevChangeListener listener)Sets Media Queue Has Next/Previous change listenervoidsetMediaQueuePlaybackStateChangeListener(MediaQueue.MediaQueuePlaybackStateChangeListener listener)Sets the Media Queue Playback state change listener.voidsetMediaQueueRepeatModeChangeListener(MediaQueue.MediaQueueRepeatModeChangeListener listener)Sets Media Queue RepeatMode change listenervoidsetMediaQueueShuffleModeChangeListener(MediaQueue.MediaQueueShuffleModeChangeListener listener)Sets Media Queue ShuffleMode change listenervoidsetMediaQueueSoundtrackChangeListener(MediaQueue.MediaQueueSoundtrackChangeListener listener)Sets Media Queue Soundtrack change listenervoidsetMediaQueueSubtitleChangeListener(MediaQueue.MediaQueueSubtitleChangeListener listener)Sets Media Queue Subtitle change listenerbooleansetRepeatMode(MediaQueue.RepeatModeType mode)Sets the media queue to play the items multiple times.booleansetShuffleMode(boolean shuffle)Sets the media queue to play the media items in random order.booleanstop()Stops the playing of the media item in the queue.
-
-
-
Method Detail
-
loadMediaQueue
public boolean loadMediaQueue(java.util.List<MediaQueueRequestItem> items, int startIndex, MediaQueue.RepeatModeType repeatMode, boolean autoPlay, MediaQueue.MediaQueueItemsAddedListener listener)
Clears existing items and loads new items to the media queue.- Parameters:
items- List of items added to the media queue.startIndex- Starts the index of items for playback.repeatMode-MediaQueue.RepeatModeTypeRepeats the playback of the media queue. By default, the repeat mode is off.autoPlay- Starts the playback of an item at launch media. A boolean value. If true, media automatically plays at media launch. If false, media does not play automatically and passenger must select the Play button.listener-MediaQueue.MediaQueueItemsAddedListenerInvoked when items are added to the media queue.- Returns:
- True, if message sent successfully. False, if message is not successfully sent.
-
addItems
public boolean addItems(java.util.List<MediaQueueRequestItem> mediaItems, MediaQueue.MediaQueueItemsAddedListener listener)
Adds items to the end of the media queue.- Parameters:
mediaItems- List of items to be added to the end of the media queue.listener-MediaQueue.MediaQueueItemsAddedListenerInvoked when items are added to the media queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
insertItems
public boolean insertItems(java.util.List<MediaQueueRequestItem> mediaItems, int position, MediaQueue.MediaQueueItemsAddedListener listener) throws java.lang.IndexOutOfBoundsException
Adds items to the specified position.
Shifts the items currently at that position and any subsequent items to the right.- Parameters:
mediaItems- List of items to be added to media queue.position- Index where the items are to be insertedlistener-MediaQueue.MediaQueueItemsAddedListenerInvoked when items are added to the media queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
- Throws:
java.lang.IndexOutOfBoundsException
-
removeItems
public boolean removeItems(java.util.List<java.lang.String> queueIds, MediaQueue.MediaQueueItemsRemovedListener listener)Removes items from the media queue.- Parameters:
queueIds- Unique identifier for the media items in the queue.listener-listener) Invoked when items are removed from the media queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
clearQueue
public boolean clearQueue(MediaQueue.MediaQueueItemsClearedListener listener)
Removes the items from the media Queue.- Parameters:
listener-MediaQueue.MediaQueueItemsClearedListenerInvoked when the items are removed from the media queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
play
public boolean play()
Starts or continues playback of the current item in the media queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
play
public boolean play(java.lang.String contentType)
Plays the media item with the specified content type.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
pause
public boolean pause()
Pauses the playing of the media item in the queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
stop
public boolean stop()
Stops the playing of the media item in the queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
jumpTo
public boolean jumpTo(java.lang.String queueId)
Jumps to media item with the specified ID in the queue.- Parameters:
queueId- Unique identifier of the item in the queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
jumpToNext
public boolean jumpToNext()
Jumps to next item in the media queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
jumpToPrev
public boolean jumpToPrev()
Jumps to previous item in the media queue.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
setDefaultSubtitleCode
public boolean setDefaultSubtitleCode(java.lang.String code)
Deprecated.Sets the default ISO 639-2 language code for the subtitles in the media queue.- Parameters:
code- Default ISO 639-2 language code for the subtitles.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
setDefaultSubtitle
public boolean setDefaultSubtitle(java.lang.String code, java.lang.String type)Sets the default ISO 639-2 language code for the subtitles in the media queue.- Parameters:
code- Default ISO 639-2 language code for the subtitles.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
setDefaultSoundtrackCode
public boolean setDefaultSoundtrackCode(java.lang.String code)
Deprecated.Sets the default ISO 639-2 language code for the soundtracks in the media queue.- Parameters:
code- Default ISO 639-2 language code for the soundtrack.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
setDefaultSoundtrack
public boolean setDefaultSoundtrack(java.lang.String code, java.lang.String type)Sets the default ISO 639-2 language code and type for the soundtrack in the media queue.- Parameters:
code- Default ISO 639-2 language code for the soundtrack.type- set soundtrack type- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
setRepeatMode
public boolean setRepeatMode(MediaQueue.RepeatModeType mode)
Sets the media queue to play the items multiple times.
Values are All to repeat all the items, None to not repeat the media queue, One to repeat only the current item or Unknown.- Parameters:
mode- Repeat mode allows the items to play multiple times.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
setShuffleMode
public boolean setShuffleMode(boolean shuffle)
Sets the media queue to play the media items in random order.- Parameters:
shuffle- Random order for playing the media items.- Returns:
- True, if message is successfully sent. False, if message cannot be sent.
-
getItems
public void getItems(PagingOption pagingOption, MediaQueue.GetMediaQueueItemsListener listener)
Gets an array of media queue items.
If the paging option is not specified, all items returned.
- Parameters:
pagingOption-PagingOptionIf not specified, all items returned.
-
getQueueItemCount
public int getQueueItemCount()
Gets the count for the number of media items in the queue.
-
getCurrentQueueItemIndex
public int getCurrentQueueItemIndex()
Gets the index position for the current media item.- Returns:
- Index for the current media item.
-
getPlaybackState
public MediaQueue.PlaybackState getPlaybackState()
Gets the playback state of the queue. Playback states include paused, playing, stopped and unknown.
-
getSubtitleCode
public java.lang.String getSubtitleCode()
Gets the default ISO 639-2 language code for the subtitles in the media queue.
-
getSubtitleType
public java.lang.String getSubtitleType()
Gets the defaults subtitle type of the media queue.
-
getSoundtrackCode
public java.lang.String getSoundtrackCode()
Gets the default ISO 639-2 language code for the soundtracks in the media queue.
-
getSoundtrackType
public java.lang.String getSoundtrackType()
Gets the default soundtrack type of the media queue.
-
getRepeatMode
public MediaQueue.RepeatModeType getRepeatMode()
Gets the repeat mode for the media queue.
Values are All to repeat all the items, None to not repeat the media queue, One to repeat only the current item or Unknown.- Returns:
- RepeatModeType
-
getLastUpdated
public long getLastUpdated()
Gets the last timestamp for the media queue.
-
hasNext
public boolean hasNext()
Gets whether the media queue has a next item.- Returns:
- True if the current playlist item has a next media item.
-
hasPrev
public boolean hasPrev()
Gets whether the media queue has a previous item.- Returns:
- True if the current playlist item has a previous media item.
-
getShuffleMode
public boolean getShuffleMode()
Returns the shuffle mode.
-
setMediaQueueChangeListener
public void setMediaQueueChangeListener(MediaQueue.MediaQueueChangeListener listener)
Sets the Media Queue change listener.- Parameters:
listener- Invoked when the media queue changes.
-
setMediaQueueCurrentIndexChangeListener
public void setMediaQueueCurrentIndexChangeListener(MediaQueue.MediaQueueIndexChangeListener listener)
Sets the Media Queue Item Index change listener.
-
setMediaQueuePlaybackStateChangeListener
public void setMediaQueuePlaybackStateChangeListener(MediaQueue.MediaQueuePlaybackStateChangeListener listener)
Sets the Media Queue Playback state change listener.- Parameters:
listener- Invoked when the playback state changes.
-
setMediaQueueSubtitleChangeListener
public void setMediaQueueSubtitleChangeListener(MediaQueue.MediaQueueSubtitleChangeListener listener)
Sets Media Queue Subtitle change listener
-
setMediaQueueSoundtrackChangeListener
public void setMediaQueueSoundtrackChangeListener(MediaQueue.MediaQueueSoundtrackChangeListener listener)
Sets Media Queue Soundtrack change listener
-
setMediaQueueShuffleModeChangeListener
public void setMediaQueueShuffleModeChangeListener(MediaQueue.MediaQueueShuffleModeChangeListener listener)
Sets Media Queue ShuffleMode change listener
-
setMediaQueueRepeatModeChangeListener
public void setMediaQueueRepeatModeChangeListener(MediaQueue.MediaQueueRepeatModeChangeListener listener)
Sets Media Queue RepeatMode change listener
-
setMediaQueueHasNextPrevChangeListener
public void setMediaQueueHasNextPrevChangeListener(MediaQueue.MediaQueueHasNextPrevChangeListener listener)
Sets Media Queue Has Next/Previous change listener
-
-