Note
This API has been available since API level 12.
This API has been available since API level 12.
Provides features to handle the AVRCP events regardless of application type (web app/native app) in order to remotely control the playback and handles key events such as play, pause, next, previous, mute and unmute.
Provides methods to manage media sessions and get metadata/playback status of the media and routes the AVRCP events received from the remote device to corresponding media client.
API level 12
Activates the media session.
Recommended usage: The API is recommended to be used by the application.
Note:
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session to be activated. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/activateMediaSession '{
"mediaId":"xDFNUI"
}'
Response:
{
"returnValue":true
}
API level 12
Deactivates the media session.
Recommended usage: The API is recommended to be used by the application.
Note: After the media session is deactivated, the corresponding media client cannot receive AVRCP key events.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session to be deactivated. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | String | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/deactivateMediaSession '{
"mediaId":"xDFNUI"
}'
Response:
{
"returnValue":true
}
API level 12
Gets the list of all the active media sessions.
Recommended usage: The API is recommended to be used by the service.
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
sessionList | Optional | String array | Indicates the list of all active sessions registered with service. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/getActiveMediaSessions '{}'
Response:
{
"returnValue":true,
"sessionList":[
"XCFRHKH",
"NBFSIEOL"
]
}
API level 30
Downloads requested cover art URI and provides downloaded path.
Name | Required | Type | Description |
---|---|---|---|
displayId | Required | Number | Display ID. |
src | Required | String array | Source URIs of cover art images. |
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
coverArtPathInfo | Required | Object array: coverArtPathInfo | Provides cover art source and download path. |
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
src | Required | String | Source URI of Requested downloaded cover Art image. |
srcPath | Required | String | Provides cover art source and downloaded path. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribe to get notifications. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
2 | Check error details | For details of a specific error, see the 'API Error codes Reference' table. |
Example scenario
# luna-send -n 3 -f luna://com.webos.service.mediacontroller/getMediaCoverArtPath '{
"displayId":0,
"src":["https://storage.googleapis.com/media-session/sintel/artwork-128.png"],
"subscribe":true
}'
Response:
{
"subscribed": true,
"returnValue": true,
"coverArtPathInfo": [
{
"src": "https://storage.googleapis.com/media-session/sintel/artwork-128.png",
"srcPath": "/media/internal/.media-session/artwork-128.png"
}
]
}
Subscription :
{
"subscribed": true,
"returnValue": true,
"src": "https://storage.googleapis.com/media-session/sintel/artwork-128.png",
"srcPath": "/media/internal/.media-session/artwork-128.png"
}
API level 12
Requests metadata of the media session related to the given mediaId.
Recommended usage: The API is recommended to be used by the service.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId for meta data information. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
metaData | Optional | Object: mediaMetaData | Indicates details of the object mediaMetaData. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/getMediaMetaData '{
"mediaId":"xDFNUI"
}'
Response:
{
"returnValue":true,
"metaData":{
"title":"Big Bang Theory",
"artist":"BIGBANG",
"totalDuration":"20.15",
"album":"BBT",
"genre":"drama",
"trackNumber":2
}
}
API level 12
Gets the current playback status of the given mediaId, status such as stopped, paused, playing, buffering.
Recommended usage: The API is recommended to be used by the service.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session registered. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
playStatus | Optional | String | Indicates the current play status of the media. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/getMediaPlayStatus '{
"mediaId":"xDFNUI"
}'
Response:
{
"returnValue":true,
"playStatus":"PLAYSTATE_PLAYING"
}
API level 12
Provides the list of mediaId of all the media sessions for a given app.
Recommended usage: The API is recommended to be used by the service.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Indicates the appId for the given media session. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
mediaId | Optional | String array | Indicates the list of all mediaId for the appId received. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/getMediaSessionId '{
"appId":"com.webos.test,youtube"
}'
Response:
{
"returnValue":true,
"mediaId":[
"XCFRHKH",
"NBFSIEOL"
]
}
API level 12
Gets the details of a media session like app id, metadata, volume info.
Recommended usage: The API is recommended to be used by the service.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId for the session registered. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
sessionInfo | Optional | Object: mediaSession | Indicates media session information details. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/getMediaSessionInfo '{
"mediaId":"xDFNUI"
}'
Response:
{
"returnValue":true,
"sessionInfo":{
"mediaId":"xDFNUI",
"appId":"com.webos.test.youtube",
"metaData":{
"title":"Big Bang Theory",
"artist":"BIGBANG",
"totalDuration":"20.15",
"album":"BBT",
"genre":"drama",
"trackNumber":2
},
"volume":100
}
}
API level 12
Sets the keyEvent of the given displayId.
Recommended usage: The API is recommended to be used by the service.
Name | Required | Type | Description |
---|---|---|---|
displayId | Required | Number | Indicates the displayId for which the key event is sent Possible values are:
|
keyEvent | Required | String | Indicates the keyEvent for the display. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4, 7 | See the API Error Codes Reference section. | See the API Error Codes Reference section |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/injectMediaKeyEvent '{
"displayId":1,
"keyEvent":"play"
}'
Response:
{
"returnValue":true
}
API level 12
Subscribes to receive the play status, mute status, play position, mediaMetaData information.
Recommended usage: The API is recommended to be used by the service.
Name | Required | Type | Description |
---|---|---|---|
displayId | Required | Number | Display for which the media play status is required. Possible values are:
|
eventType | Optional | String | Indicates the status for the required event type. Note: If not set, eventType will send all the possible values as the response. Possible values are:
|
subscribe | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications (check subscribe parameter). |
displayId | Optional | Number | Display ID for the required media play status. Possible values are:
|
eventType | Optional | String | Indicates the status for the required subscription response. Note: If not set, eventType will send all the possible values as the response. Possible values are:
|
playStatus | Optional | String | Indicates the current play status of the media. Note: Available only if eventType is playStatus. Possible values are:
|
muteStatus | Optional | String | Indicates the current status of the media. Note: Available only if eventType is muteStatus. Possible values are:
|
playPosition | Optional | String | Indicates the current play position of the media. Note: Available only if eventType is playPosition. |
mediaMetaData | Optional | Object: mediaMetaData | Indicates the metadata information for the playback. Note: Available only if eventType is mediaMetaData. |
coverArt | Optional | Object array: coverArtInfo | Details of media cover art. Note: Available only if eventType is coverArt. |
supportedActions | Optional | String array | List of supported actions that are specified in setSupportedActions method. Note: Available only if eventType is supportedActions. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. |
subscribed | Optional | Boolean | Indicates if subscribed to get notifications (check subscribe parameter). |
displayId | Optional | Number | Display ID for the required media play status. Possible values are:
|
eventType | Optional | String | Indicates the status for the required subscription response. Note: If not set, eventType will send all the possible values as the response. Possible values are:
|
playStatus | Optional | String | Indicates the current play status of the media. Note: Available only if eventType is playStatus. Possible values are:
|
muteStatus | Optional | String | Indicates the current status of the media. Note: Available only if eventType is muteStatus. Possible values are:
|
playPosition | Optional | String | Indicates the current play position of the media playback. Note: Available only if eventType is playPosition. |
mediaMetaData | Optional | Object: mediaMetaData | Indicates the metadata information for the playback. Note: Available only if eventType is mediaMetaData. |
coverArt | Optional | Object array: coverArtInfo | Details of media cover art. Note: Available only if eventType is coverArt. |
supportedActions | Optional | String array | List of supported actions that are specified in setSupportedActions method. Note: Available only if eventType is supportedActions. |
Error Code | Error Text | Error Description |
---|---|---|
2, 10, 11, 12 | See the API Error Codes Reference section | See the API Error Codes Reference section |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/receiveMediaPlaybackInfo '{
"displayId":0,
"eventType":"supportedActions",
"subscribe":true
}'
Response:
{
"subscribed": true,
"displayId": 0,
"returnValue": true,
"supportedActions": [
"play",
"pause",
"stop",
"seekTo",
"scrubTo",
"enterPictureInPicture",
"exitPictureInPicture"
],
"eventType": "supportedActions"
}
Example scenario
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/receiveMediaPlaybackInfo '{
"displayId":0,
"subscribe":true
}'
Response:
{
"returnValue": true,
"coverArt": [
{
"sizes": [
{
"width": 128,
"height": 128
}
],
"src": "https://storage.googleapis.com/media-session/sintel/artwork-128.png",
"type": "image/png"
}
],
"displayId": 0,
"playPosition": "1.0",
"subscribed": true,
"mediaMetaData": {
"artist": "BigBang",
"trackNumber": 2,
"album": "BBT",
"totalDuration": "20.15",
"title": "BigBangTheory",
"volume": 100,
"genre": "drama"
},
"playStatus": "PLAYSTATE_PLAYING",
"muteStatus": "mute"
}
Example : For eventType as playStatus
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/receiveMediaPlaybackInfo '{
"displayId":0,
"eventType":"playStatus",
"subscribe":true
}'
Response:
{
"playStatus": "PLAYSTATE_PLAYING",
"displayId": 0,
"returnValue": true,
"subscribed": true,
"eventType": "playStatus"
}
Example : For eventType as muteStatus
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/receiveMediaPlaybackInfo '{
"displayId":0,
"eventType":"muteStatus",
"subscribe":true
}'
Response:
{
"subscribed": true,
"displayId": 0,
"returnValue": true,
"muteStatus": "mute",
"eventType": "muteStatus"
}
Exameple : For eventType as playPosition
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/receiveMediaPlaybackInfo '{
"displayId":0,
"eventType":"playPosition",
"subscribe":true
}'
Response:
{
"playPosition": "1.0",
"displayId": 0,
"returnValue": true,
"subscribed": true,
"eventType": "playPosition"
}
Example : For eventType as metaData
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/receiveMediaPlaybackInfo '{
"displayId":0,
"eventType":"mediaMetaData",
"subscribe":true
}'
Response:
{
"subscribed": true,
"displayId": 0,
"returnValue": true,
"mediaMetaData": {
"artist": "BigBang",
"trackNumber": 2,
"album": "BBT",
"totalDuration": "20.15",
"title": "BigBangTheory",
"volume": 100,
"genre": "drama"
},
"eventType": "mediaMetaData"
}
Example : For eventType as coverArt
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/receiveMediaPlaybackInfo '{
"displayId":0,
"eventType":"coverArt",
"subscribe":true
}'
Response:
{
"coverArt": [
{
"sizes": [
{
"width": 128,
"height": 128
}
],
"src": "https://storage.googleapis.com/media-session/sintel/artwork-128.png",
"type": "image/png"
}
],
"displayId": 0,
"returnValue": true,
"subscribed": true,
"eventType": "coverArt"
}
API level 12
Registers media sessions, subscribes to receive AVRCP key events.
Recommended usage: The API is recommended to be used by the application.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session to be registered. |
appId | Required | String | Indicates the appId of the session to be registered. |
subscribe | Required | Boolean | Indicates if subscribe to get notifications. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
keyEvent | Optional | String | Indicates the key event that is operated. Possible values are:
|
mediaId | Optional | String | Indicates the mediaId of the registered session. |
errorCode | Optional | Boolean | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. Possible values are:
Note: subscribed will always contain true since subscription ends only when the client chooses to close it. |
keyEvent | Required | String | Indicates the key event that is operated. Possible values are:
|
mediaId | Required | String | Indicates the mediaId for which the key events are posted. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See API Error Codes Reference | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/registerMediaSession '{
"mediaId":"xDFNUI",
"appId":"com.webos.app.test.youtube",
"subscribe":true
}'
Response:
{
"subscribed":true,
"returnValue":true
}
API level 30
Sets the cover art data for media session.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Media ID of the registered session. |
coverArt | Required | Object array: coverArtInfo | Cover art information of the media session. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
0, 2 | Check error details | For details of a specific error, see the 'API Error codes Reference' table. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/setMediaCoverArt '{
"mediaId":"xDFNUI",
"coverArt":[
{
"src":"https://storage.googleapis.com/media-session/sintel/artwork-96.png",
"type":"image/png",
"sizes":[
{
"height":96,
"width":96
}
]
},
{
"src":"https://storage.googleapis.com/media-session/sintel/artwork-128.png",
"type":"image/png",
"sizes":[
{
"height":128,
"width":128
}
]
}
]
}'
Response:
{
"returnValue": true,
}
API level 12
Sets the metadata information for the session.
Example: title, artist.
Recommended usage: The API is recommended to be used by the application.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session to set metadata. |
mediaMetaData | Required | Object: mediaMetaData | Indicates the meta data details for the session. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the API Error Codes Reference section | See the API Error Codes Reference section |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/setMediaMetaData '{
"mediaId":"xDFNUI",
"mediaMetaData":{
"title":"BigBangTheory",
"artist":"BigBang",
"totalDuration":"10.10",
"album":"BBT",
"genre":"drama",
"trackNumber":2,
"volume":100
}
}'
Response:
{
"returnValue":true
}
API level 12
Sets the status of the media session.
Recommended usage: The API is recommended to be used by the application.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session required to set the muteStatus. |
muteStatus | Required | String | Indicates the status of the media session. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4, 7 | See the API Error Codes Reference section | See the API Error Codes Reference section. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/setMediaMuteStatus '{
"mediaId":"xDFNUI",
"muteStatus":"mute"
}'
Response:
{
"returnValue":true
}
API level 12
Sets the play position for the media session.
Recommended usage: The API is recommended to be used by the application.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session. |
playPosition | Required | String | Indicates the current play position of the media session. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4, 7 | See the API Error Codes Reference sectio | See the API Error Codes Reference section |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/setMediaPlayPosition '{
"mediaId":"xDFNUI",
"playPosition":"10.10"
}'
Response:
{
"returnValue":true
}
API level 12
Sets the playStatus for the session.
Example: play, pause, stopped and so on.
Recommended usage: The API is recommended to be used by the application.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session to set playStatus. |
playStatus | Required | String | Indicates the current playStatus of the media. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 , 8 | See the API Error Codes Reference section. | See the API Error Codes Reference section |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/setMediaPlayStatus '{
"mediaId":"xQWERTY_0",
"playStatus":"PLAYSTATE_PLAYING"
}'
Response:
{
"returnValue":true
}
API level 31
Sets the list of supported media actions.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Media ID of the registered session. |
supportedActions | Required | String array | List of actions to be supported. It can include values such as:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
0, 2 | Check error details. | For details of a specific error, see the API Error Codes Reference table. |
Example : Set play, pause, and next as supported actions
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/setSupportedActions '{"mediaId":"xDFNUI", "supportedActions":["play", "pause", "next"]}'
Response:
{
"returnValue": true
}
API level 12
Unsubscribes and unregisters the media session.
Recommended usage: The API is recommended to be used by the application.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId of the session to be unregistered. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
0, 1, 2, 3, 4 | See the "API Error Codes Reference" section. | See the API Error Codes Reference section. |
Example code
# luna-send -n 1 -f luna://com.webos.service.mediacontroller/unregisterMediaSession '{
"mediaId":"xDFNUI"
}'
Response:
{
"returnValue":true
}
Details of media cover art.
Name | Required | Type | Description |
---|---|---|---|
src | Required | String | Source URI of cover Art image. |
type | Optional | String | Type of image format. |
sizes | Optional | Object array: sizes | Size of images. |
Provides cover art source URI and downloaded path.
Name | Required | Type | Description |
---|---|---|---|
src | Required | String | Source URI of cover art image. |
srcPath | Required | String | Provides downloaded cover art source path |
Contains the mediaMetaData information.
Name | Required | Type | Description |
---|---|---|---|
title | Optional | String | Indicates the title of the media. |
artist | Optional | String | Indicates information about the artist. |
totalDuration | Optional | String | Indicates the total duration of the media. |
album | Optional | String | Indicates details about the album. |
genre | Optional | String | Indicates details about the genre. |
trackNumber | Optional | Number | Indicates the track number. |
volume | Optional | Number | Indicates the current volume level of the session. |
Contains the details about mediaId, appId, and metaData.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the mediaId to be registered. |
appId | Required | String | Indicates the corresponding appId of the mediaId. |
metaData | Required | Object: mediaMetaData | Indicates the details of metaData such as title, artist, total duration, album, genre, and track number. |
Provides possible sizes for each cover art
Name | Required | Type | Description |
---|---|---|---|
width | Optional | Number | Indicates the width of the image. |
height | Optional | Number | Indicates the height of the image. |
Error Code | Error Text | Error Description |
---|---|---|
0 | Invalid mediaId | Indicates that the mediaId received is invalid. |
1 | MediaId registration failed | Indicates the failure of mediaId registration. |
2 | Parsing Error | Indicates parsing of data has failed. |
3 | Invalid appId | Indicates that the appId does not match the mediaId. |
4 | No active session | Indicates that no session is active. |
5 | Media Session already registered | Indicates that session is already registered |
6 | Media Session already active | Indicates that session is already activated |
7 | Media Session already decativated | Indicates that session is already deactivated |
8 | Invalid Play Status | Indicates Invalid play state of media. |
10 | "" (empty) | Indicates No Error |
11 | Invalid displayId | Indicates invalid displayid |
12 | Invalid Event | Indicates invalid event |
Contents