Android Remote Control#
Step 1: Remote Controller 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 player.
a. Property Declaration
remoteControl is declared as a property of the class. This object represents the service that manages the remote control 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
remoteControl = new SeatRemoteControlV1(context);
// Set the seat pairing session object for remote control services
remoteControl.setSeatPairingSessionObject(pairing);
}
}
@Override
public void onInitServiceFailed(String s, InFlight.Error error) {
// Handle initialization failure
}
}, new InFlight());
-
Step 1: Initialize SeatPairingService: Calls
initServiceon theSeatPairingV1, passing a callback to handle successful initialization. -
Step 2: Store SeatPairingService Instance: The
SeatPairingV1object is stored in a class-level property calledmSeatPairingV1. This allows other parts of the app to interact with the pairing service. -
Step 3:
setSeatPairingSessionObject: Sets the seat pairing session object to enable receiving events and sending remote commands to the seatback monitor. This method establishes a session for managing remote control services, allowing interaction with the seatback monitor based on the provided session object.
To ensure smooth operation of the media player, the remote controller feature needs to be integrated with the media queue. The remote controller provides essential details to the media player, such as media duration, elapsed time, seek functionality, and other features.
Step 2: Launch Media Request:#
// Create and set attributes for the media
SeatMediaRemoteControlAttribute attribute = new SeatMediaRemoteControlAttribute();
attribute.setSoundTrack("eng"); // Example value for SoundTrack
attribute.setSubtitle("eng"); // Example value for Subtitle
attribute.setCategoryId("123"); // Example value for CategoryId
String textElapseTime = "120"; // Example value for Elapsed Time
attribute.setStartOffset(Float.parseFloat(textElapseTime));
// Call launchMedia() to launch the media with the specified URI and attributes
SeatMediaRemoteController.Status status = remoteControl.launchMedia(
"123", // Example Media URI
"4582", // Example Global URI
"movie", // Example Content Type
attribute,
new SeatRemoteControlV1.SeatRemoteControlListener() {
@Override
public void onSeatRemoteControlCommandSendSuccess() {
// Command send success handling
}
@Override
public void onSeatRemoteControlCommandSendError(SeatRemoteControlV1.Error error) {
// Command send error handling
}
}
);
Purpose: This method launches the playback of a media URI on a remote paired seatback monitor.
Detailed Description: The launchMedia method initiates the playback of media specified by the mediaUri on a remote paired seatback monitor. The globalUri parameter can be used to provide a global URI reference, while the contentType parameter specifies the type of the content being played (e.g., video, audio). The attrib parameter allows for the specification of various attributes related to the media playback. The method also takes a listener of type SeatRemoteControlV1.SeatRemoteControlListener to handle events related to the media playback control.
Parameters:
-
mediaUri:
String- The URI of the media to be played. -
globalUri:
String- A global URI reference for the media. -
contentType:
String- The type of content (e.g., video, audio). -
attrib:
SeatMediaRemoteControlAttribute- Attributes related to the media playback. -
listener:
SeatRemoteControlV1.SeatRemoteControlListener- Listener to handle media playback control events.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the media launch operation.
Usage: You can call this method to initiate the playback of media on a remote paired seatback monitor. Provide the necessary URIs, content type, attributes, and a listener to handle playback events.
Step 3: Get Remote Controller info:#
List<SeatMediaRemoteController> seatControllers = remoteControl.getSeatMediaRemoteControllers();
// Iterate through each controller and log their info
for (SeatMediaRemoteController src : seatControllers) {
SeatMediaRemoteController.SeatMediaPlayerInfo info = src.getSeatPlayerInfo();
if (info != null) {
Log.v(TAG, "SeatMediaPlayerInfo=" + info.toString());
Log.v(TAG, "RemoteControllerId=" + info.getRemoteControllerId());
Log.v(TAG, "MediaUri=" + info.getMediaUri());
Log.v(TAG, "ParentMediaUri=" + info.getParentMediaUri());
Log.v(TAG, "PlaybackStatus=" + (info.getMediaPlaybackState() != null ? info.getMediaPlaybackState().name() : "null"));
Log.v(TAG, "MediaType=" + info.getMediatype().name());
Log.v(TAG, "ElapsedTime=" + info.getMediaElapsedTime());
Log.v(TAG, "Duration=" + info.getDuration());
Log.v(TAG, "Volume=" + info.getVolume());
Log.v(TAG, "TimeLastUpdated=" + (info.getTimeLastUpdated() != null ? info.getTimeLastUpdated().toString() : "null"));
Log.v(TAG, "Subtitle=" + info.getSubtitle());
Log.v(TAG, "SoundTrack=" + info.getSoundTrack());
Log.v(TAG, "ContentType=" + info.getContentType());
}
}
Method: getSeatMediaRemoteControllers
Purpose: This method returns an array of objects that represent the seat media remote controllers. These controllers are used to manage the playback of media on the seatback monitor.
Detailed Description: The getSeatMediaRemoteControllers method provides access to a list of remote controllers designed for interacting with the media player integrated into the seatback monitor. Each object in the returned array is an instance of the SeatMediaRemoteController class, which includes various functionalities to control media playback, such as play, pause, fast-forward, and rewind.
Return Value:
-
Type:
ArrayList<SeatMediaRemoteController> -
Contents: An array list of
SeatMediaRemoteControllerobjects.
Usage: You can call this method to obtain the list of available remote controllers. Once you have this list, you can use the controllers to send commands from a personal electronic device (PED) to the seatback monitor, thereby controlling the media playback as desired. The returned list is valid only with SeatRemoteControlV1.SeatMediaRemoteControllerChangedListener invocation. A null object or an empty list will be returned if the above callback is not triggered.
Step 4: Get Media player items info:#
Notifications
// Set the Seat Media Remote Controller Changed Listener
remoteControl.setSeatMediaRemoteControllerChangedListener(new SeatRemoteControlV1.SeatMediaRemoteControllerChangedListener() {
@Override
public void onSeatMediaRemoteControllerChanged(ArrayList<SeatMediaRemoteController> arrayList) {
// Handle changes in SeatMediaRemoteController here
// Example: Iterate over the list of SeatMediaRemoteControllers and perform actions
for (SeatMediaRemoteController controller : arrayList) {
// Example: Process each SeatMediaRemoteController instance
// You can access methods and properties of each controller here
}
// Optionally, update UI or internal state based on the changes
}
});
1. Method: public void setSeatMediaRemoteControllerChangedListener(SeatRemoteControlV1.SeatMediaRemoteControllerChangedListener listener)
Description: Sets a callback listener that will be invoked when a media remote controller is added to or removed from the seatback monitor. This method allows the application to be notified of changes in the availability of media remote controllers associated with the seatback monitor.
Parameters:
- listener:
remoteControl.SeatMediaRemoteControllerChangedListener- The callback listener that will be notified when a media remote controller is added or removed. The listener should implement the necessary methods to handle these changes.
Return Value:
-
Type:
void -
Contents: This method does not return a value. It registers the provided listener to receive notifications about the addition or removal of media remote controllers.
2. Method: public void setSeatRemoteControllerInfoChangedListener(SeatRemoteControlV1.SeatRemoteControllerInfoChangedListener listener)
// Set the Seat Remote Controller Info Changed Listener
remoteControl.setSeatRemoteControllerInfoChangedListener(new SeatRemoteControlV1.SeatRemoteControllerInfoChangedListener() {
@Override
public void onSeatMediaRemoteControllerInfoChanged(SeatMediaRemoteController remoteController, int what, int extra) {
// Handle changes to SeatMediaRemoteController info here
SeatMediaRemoteController.SeatMediaPlayerInfo info = remoteController.getSeatPlayerInfo();
if (info != null) {
Log.v(TAG, "SeatMediaPlayerInfo=" + info.toString());
Log.v(TAG, "RemoteControllerId=" + info.getRemoteControllerId());
Log.v(TAG, "MediaUri=" + info.getMediaUri());
Log.v(TAG, "ParentMediaUri=" + info.getParentMediaUri());
Log.v(TAG, "PlaybackStatus=" + (info.getMediaPlaybackState() != null ? info.getMediaPlaybackState().name() : "null"));
Log.v(TAG, "MediaType=" + info.getMediatype().name());
Log.v(TAG, "ElapsedTime=" + info.getMediaElapsedTime());
Log.v(TAG, "Duration=" + info.getDuration());
Log.v(TAG, "Volume=" + info.getVolume());
Log.v(TAG, "TimeLastUpdated=" + (info.getTimeLastUpdated() != null ? info.getTimeLastUpdated().toString() : "null"));
Log.v(TAG, "Subtitle=" + info.getSubtitle());
Log.v(TAG, "SoundTrack=" + info.getSoundTrack());
Log.v(TAG, "ContentType=" + info.getContentType());
}
// remoteController: The updated SeatMediaRemoteController object
}
});
Description: Sets a callback listener that will be invoked when there is a change in the playback state of any seat media controller object. This method allows the application to respond to updates in the playback status of media controllers associated with the seatback monitor.
Parameters:
- listener:
remoteControl.SeatRemoteControllerInfoChangedListener- The callback listener that will be notified of changes in playback state. The listener should implement the necessary methods to handle these playback state changes.
Return Value:
-
Type:
void -
Contents: This method does not return a value. It registers the provided listener to receive notifications about playback state changes in seat media controllers.
How to Implement and Use a Listener for Playback State Changes
1. Receiving Updates from the Seatback System
-
The app listens for notifications (
setSeatRemoteControllerInfoChangedListener) from the seatback system. -
Every time this notification is received, the app:
-
Updates the current playback time (
getMediaElapsedTime) using the elapsed time from theSeatMediaPlayerInfo. -
Updates the total duration (
getDuration) of the media. -
Checks the playback state (e.g., playing, paused, stopped) and takes appropriate action.
2. Simulating Smooth Progress
-
Implement timer runs every second to simulate the playback progress.
-
This timer increases the current playback time by 1 second until the next update is received from the seatback system.
3. Updating the Seek Bar
-
The app calculates the progress by dividing the current playback time by the total duration
-
The seek bar is updated with this progress to show the correct playback position.
4. Handling Playback States
-
If the media is playing, the timer keeps running to simulate progress.
-
If the media is paused or stopped, the timer stops so that progress halts.
5. Seek Bar UI Refresh
- Whenever the elapsed time changes (via updates from the seatback or the timer), the app updates the seek bar's position immediately.
Flow Example#
1. When Playback Starts:
-
The seatback sends initial playback information.
-
The app updates the seek bar and starts a timer to simulate smooth progress.
2. While Playing:
- Every second, the timer increments the elapsed time locally, and the seek bar moves smoothly.
3. When the Seatback Sends Updates:
- The app adjusts the elapsed time based on the latest data from the seatback and continues simulating progress.
4. If Playback Pauses:
- The app stops the timer, and the seek bar freezes at the current position.
Step 5: Create bookmark locally using media currently playing:#
Method : public SeatBookmarkV1.Bookmark createBookmark() throws Exception
Description: Creates a Bookmark object that includes the media URI and the elapsed time of the current SeatMediaPlayerInfo. This allows passengers to save their current playback position and resume from that point on a paired device or seatback monitor.
Returns:
- Type:
SeatBookmarkV1.Bookmark- A bookmark object containing the media URI and elapsed playback time.
Throws:
- Exception - Thrown if there are no media items available to create a bookmark.
try {
// Create a new bookmark using the obtained remoteController
SeatBookmarkV1.Bookmark bookmark = remoteController.createBookmark();
// Convert the bookmark to a JSON string
String bookmarkJson = bookmark.toJsonString();
} catch (Exception e) {
// Handle errors related to creating the bookmark
}
Step 6 : Media Control Methods :#
Media Control Commands
// Send the Play Media Item command using the obtained controller
controller.sendPlayMediaItemCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the play media item command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the play media item command
}
});
1. Method: public SeatMediaRemoteController.Status sendPlayMediaItemCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
Description: Sends a playback command to the remotely paired seatback monitor. Upon receiving this command, the seatback monitor prepares the media from the current media URI and either starts playback of the loaded media or resumes playback if it was previously paused.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the playback command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the playback command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
2. Method: public SeatMediaRemoteController.Status sendPauseMediaItemCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Send the Pause Media Item command using the obtained controller
controller.sendPauseMediaItemCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the pause media item command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the pause media item command
}
});
Description: Sends a command to pause the playback of the current media URI to the remotely paired seatback monitor. This method pauses the ongoing media playback on the seatback monitor.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the pause command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the pause command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
3. Method: public SeatMediaRemoteController.Status sendStopMediaItemCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Send the Stop Media Item command using the obtained controller
controller.sendStopMediaItemCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the stop media item command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the stop media item command
}
});
Description: Sends a command to stop the playback of the current media URI to the remotely paired seatback monitor. This method stops the ongoing media playback on the seatback monitor.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the stop command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the stop command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
4. Method: public SeatMediaRemoteController.Status sendSeekToCmd(int positionSec, SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Define the seek time in seconds (e.g., 120 seconds = 2 minutes)
int seekTimeInSeconds = 120;
// Send the Seek To command using the obtained controller
mSeatMediaRemoteController.sendSeekToCmd(seekTimeInSeconds, new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the seek to command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the seek to command
}
});
Description: Sends a request to seek to a new playback position on the remotely paired seatback monitor. This command allows the media playback to jump to a specified position in the content.
Parameters:
-
positionSec:
int- The new content position for the item in seconds. A value of 0 will restart playback from the beginning. -
listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the seek command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the seek command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
5. Method: public SeatMediaRemoteController.Status sendPlayNextTrackCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Send the Play Next Track command using the obtained controller
controller.sendPlayNextTrackCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the play next track command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the play next track command
}
});
Description: Sends a command to play the next track to the remotely paired seatback monitor. This command advances the media playback to the subsequent track in the playlist or media queue.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the play next track command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the play next track command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
6. Method: public SeatMediaRemoteController.Status sendPlayPreviousTrackCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Send the Play Previous Track command using the obtained controller
controller.sendPlayPreviousTrackCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the play previous track command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the play previous track command
}
});
Description: Sends a command to play the previous track to the remotely paired seatback monitor. This command reverts the media playback to the preceding track in the playlist or media queue.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the play previous track command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the play previous track command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
7. Method: public SeatMediaRemoteController.Status sendSkipForwardCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Send the Skip Forward command using the obtained controller
controller.sendSkipForwardCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the skip forward command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the skip forward command
}
});
Description: Sends a command to skip forward to the remotely paired seatback monitor. This command advances the playback by a predefined amount or to the next segment of the media.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the skip forward command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the skip forward command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
8. Method: public SeatMediaRemoteController.Status sendSkipBackwardCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Send the Skip Backward command using the obtained controller
controller.sendSkipBackwardCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the skip backward command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the skip backward command
}
});
Description: Sends a command to skip backward to the remotely paired seatback monitor. This command rewinds the playback by a predefined amount or to the previous segment of the media.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the skip backward command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the skip backward command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
9. Method: public SeatMediaRemoteController.Status sendSetVolumeCmd(int absoluteValue, SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Define the volume value (e.g., 50 for 50% volume)
int volumeValue = 50;
// Send the Set Volume command using the obtained controller
mSeatMediaRemoteController.sendSetVolumeCmd(volumeValue, new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the set volume command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the set volume command
}
});
Description: Sends a command to set the volume to a specific level on the remotely paired seatback monitor. This method allows the volume to be adjusted to an absolute value between 0 and 100.
Parameters:
-
absoluteValue:
int- The absolute volume level to be set, ranging from 0 (muted) to 100 (maximum volume). -
listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the set volume command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the set volume command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
10. Method: public SeatMediaRemoteController.Status sendVolumeUpCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Send the Volume Up command using the obtained controller
SeatMediaRemoteController.Status status = mSeatMediaRemoteController.sendVolumeUpCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the volume up command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the volume up command
}
});
Description: Sends a command to increase the volume on the remotely paired seatback monitor. This method raises the volume level by a predefined increment.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the volume up command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the volume up command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
11. Method: public SeatMediaRemoteController.Status sendVolumeDownCmd(SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Send the Volume Down command using the obtained controller
controller.sendVolumeDownCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the volume down command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the volume down command
}
});
Description: Sends a command to decrease the volume on the remotely paired seatback monitor. This method lowers the volume level by a predefined increment.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the volume down command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the volume down command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
12. Method: public SeatMediaRemoteController.Status sendSetSubtitleCmd(String subtitleCode, SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Define the ISO code for the subtitle language (e.g., "en" for English)
String isoCode = "en";
// Send the Set Subtitle command using the obtained controller
controller.sendSetSubtitleCmd(isoCode, new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the set subtitle command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the set subtitle command
}
});
Description: Sends a command to set or adjust subtitles on the remotely paired seatback monitor. This method allows you to specify a subtitle code to activate a particular subtitle track or turn subtitles off if null is provided.
Parameters:
-
subtitleCode:
String- A unique code representing the subtitle, such as a language ISO code. Ifnull, the command turns off subtitles. -
listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the set subtitle command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the set subtitle command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
13. Method: public SeatMediaRemoteController.Status setSoundTrack(String soundTrackCode, SeatMediaRemoteController.SeatMediaRemoteControlListener listener)
// Define the ISO code for the soundtrack (e.g., "en" for English)
String isoCode = "en";
// Send the Set Sound Track command using the obtained controller
controller.setSoundTrack(isoCode, new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the set sound track command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the set sound track command
}
});
Description: Sets the soundtrack code for the media currently playing on the remotely paired seatback monitor. This method allows you to specify a soundtrack code to switch the audio track or use the default soundtrack if null is provided.
Parameters:
-
soundTrackCode:
String- A unique code representing the soundtrack, such as a language ISO code. Ifnull, the default soundtrack is used. -
listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the set soundtrack command. The listener provides feedback on the success or failure of the command.
Return Value:
-
Type:
SeatMediaRemoteController.Status -
Contents: The status of the set soundtrack command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
14. Method: public Status sendSkipAdvertCmd(SeatMediaRemoteControlListener listener)
controller.sendSkipAdvertCmd(new SeatMediaRemoteController.SeatMediaRemoteControlListener() {
@Override
public void onSeatMediaRemoteControlCommandSendSuccess() {
// Handle the success case for sending the set sound track command
}
@Override
public void onSeatMediaRemoteControlCommandSendError(SeatMediaRemoteController.Error error) {
// Handle the error case for sending the set sound track command
}
});
Description: Sends a command to the Interactive to request skipping the advertisement. The actual logic and behavior for skipping the advertisement are handled entirely by the Interactive. In this flow, the PED only acts as a command initiator and does not manage the skip operation itself.
Parameters:
- listener:
SeatMediaRemoteController.SeatMediaRemoteControlListener- The listener that handles events related to the skip advertisement command. The listener provides feedback on the success or failure of the command.
Return Value:
- Type:
SeatMediaRemoteController.Status - Contents: The status of the skip advert command operation, indicating whether the command was successfully sent and processed by the seatback monitor.
Version 1.0