com.webos.media
API Summary
Provides access to the functionality provided by the webOS media server. The webOS media server supports both managed and unmanaged pipelines. For managed pipelines, com.webos.media provides high-level methods to control the playback of media content (e.g. load, play, seek). For unmanaged pipelines, com.webos.media provides low-level methods for resource management and display control.
Direct use of com.webos.media by application developers is strongly discouraged. Instead, the media interfaces native to a particular application framework (e.g. Web, QT, SDL/NDL) should be used.
Overview of the API
See Summary.
Methods
load
Description
Loads a new pipeline for the specified URI. The media server returns a unique id to the client which is used for subsequent operations on the pipeline.
Parameters
Name | Required | Type | Description |
---|---|---|---|
uri | Required | String | Indicates the uri of the media object. Example: http://mymovie.mp4, file://mymovie.mp4 |
type | Required | String | Indicates the type of pipeline to load. Note:
|
payload | Optional | Object: payload | See "payload" object. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns '0' even when the returnValue is true and returns '-1' if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media/camera pipeline which is used for subsequent operations. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/load '{
"uri":"https://media.w3.org/2010/05/sintel/trailer.mp4",
"type":"media",
"payload":{
"option":{
"appId":"com.webos.app.enactbrowser",
"windowId":"_Window_Id_2"
}
}
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_Pvzj2FRn42sL99"
}
Example: Load camera with System V shared memory
# luna-send -n 1 luna://com.webos.media/load '{
"uri":"camera://com.webos.service.camera2/7010",
"payload":{
"option":{
"appId":"com.webos.app.mediaevents-test",
"windowId":"_Window_Id_1",
"videoDisplayMode":"Textured",
"width":640,
"height":480,
"format":"JPEG",
"frameRate":30,
"memType":"shmem",
"memSrc":"7010"
}
},
"type":"camera"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_puV0o3WTEsbgDt"
}
Note: For Open Emulator, while executing the luna-send command directly in console, send "windowId" as empty. The first frame of camera data directly displays on the emulator window.
Example : Load camera with Posix shared memory
# luna-send -n 1 luna://com.webos.media/load '{
"uri":"camera://com.webos.service.camera2/7010",
"payload":{
"option":{
"appId":"com.webos.app.mediaevents-test",
"windowId":"_Window_Id_1",
"videoDisplayMode":"Textured",
"width":640,
"height":480,
"format":"JPEG",
"frameRate":30,
"memType":"posixshm",
"memSrc":"9",
"handle":4286
}
},
"type":"camera"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_puV0o3WTEsbgDt"
}
Note: For Open Emulator, while executing the luna-send command directly in console, send "windowId" as empty. The first frame of camera data directly displays on the emulator window.
Example : Load camera with MMAP mode
# luna-send -n 1 luna://com.webos.media/load '{
"uri":"camera://com.webos.service.camera2/7010",
"payload":{
"option":{
"appId":"com.webos.app.mediaevents-test",
"windowId":"_Window_Id_1",
"videoDisplayMode":"Textured",
"width":640,
"height":480,
"format":"JPEG",
"frameRate":30,
"memType":"device",
"memSrc":"/dev/video1"
}
},
"type":"camera"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_puV0o3WTEsbgDt"
}
Note: For Open Emulator, while executing the luna-send command directly in console, send "windowId" as empty. The first frame of camera data directly displays on the emulator window.
Example : Load camera with DMABUF mode
# luna-send -n 1 luna://com.webos.media/load '{
"uri":"camera://com.webos.service.camera2/7010",
"payload":{
"option":{
"appId":"com.webos.app.mediaevents-test",
"windowId":"_Window_Id_1",
"videoDisplayMode":"Textured",
"width":640,
"height":480,
"format":"JPEG",
"frameRate":30,
"memType":"device",
"memSrc":"/dev/video1",
"iomode":2
}
},
"type":"camera"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_puV0o3WTEsbgDt"
}
unload
Description
Unloads the pipeline and releases all AV resources.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | String | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media/camera pipeline which is requested to unload. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/unload '{"mediaId":"_Pvzj2FRn42sL99"}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_Pvzj2FRn42sL99"
}
notifyForeground
Description
Marks a pipeline as foreground. This API is called when the media object in question is un-carded and made visible.
Note: Foreground pipeline video content is currently visible on the display surface.
Parameters
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the registered pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: The notifyForeground method may fail because of:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/notifyForeground '{
"connectionId":"_z6SJt11Yx0mVp1"
}'
Response:
{
"returnValue":true
}
notifyBackground
Description
Marks a pipeline as background. This API is called when the media object in question is carded, deleted, or otherwise removed from view.
Note: Background video content is not currently visible on the display surface.
Parameters
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the registered pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: The notifyBackground method may fail because of:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/notifyBackground '{
"connectionId":"_c5zE4w2k7rqmC5"
}'
Response:
{
"returnValue": true
}
subscribe
Description
Subscribes the media client to receive events from a media pipeline. These events, described in the tables above, allow the media client (generally an app or test tool) to monitor pipeline status (including playback position) and adjust their internal state appropriately.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the operation Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Optional | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested to subscribe. |
subscription | Optional | String | Indicates the current subscription status. Possible values are:
|
Subscription Returns
Name | Required | Type | Description |
---|---|---|---|
loadCompleted | Optional | Object | See "loadCompleted" event. |
seekDone | Optional | Object | See "seekDone" event. |
endOfStream | Optional | Object | See "endOfStream" event. |
currentTime | Optional | Object | See "currentTime" event. |
bufferRange | Optional | Object | See "bufferRange" event. |
bufferingStart | Optional | Object | See "bufferingStart" event. |
bufferingEnd | Optional | Object | See "bufferingEnd" event. |
sourceInfo | Optional | Object | See "sourceInfo" event. |
videoInfo | Optional | Object | See "videoInfo" event. |
audioInfo | Optional | Object | See "audioInfo" event. |
error | Optional | Object | See "error" event. |
Example
Example code
# luna-send -n 2 -f luna://com.webos.media/subscribe '{
"mediaId":"_rTNwzp81clPsxX"
}'
Response:
{
"subscription": true
}
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_rTNwzp81clPsxX"
}
attach
Description
Allows to transfer the control of a pipeline to be handed over to a different client. When this occurs, the original client gets notified that it got detached from the pipeline and can no longer control the pipeline.
Note: This method was added to address a specific early boot situation where the pipeline was initially created by one client process and then another client process takes over control of the pipeline.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested to subscribe. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/attach '{
"mediaId":"_IsGbw614gu7xRB"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
play
Description
Requests the media server to play the media object.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media/camera pipeline which is requested to play. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/play '{"mediaId":"_IsGbw614gu7xRB"}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
pause
Description
Requests the media server to pause the media object.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media/camera pipeline which is requested to pause. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/pause '{
"mediaId":"_IsGbw614gu7xRB"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
seek
Description
Seeks the media object to a specified time position.
Parameters
Name | Required | Type | Description |
---|---|---|---|
position | Required | Number | Indicates the position (in milliseconds) from the start position to seek position. |
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested to seek. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/seek '{
"position":64935,
"mediaId":"_IsGbw614gu7xRB"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
registerPipeline
Description
Registers with the Resource Manager. Session is persistent across all start/end transaction and acquire/release cycles. Registered clients and their current resource requirements will be tracked by Resource Manager. Param type as specified in Resource Manager configuration file pipeline settings.
Note: This method is applicable for unmanaged pipelines only. For managed pipelines, this is taken care of internally by the mediaserver.
Parameters
Name | Required | Type | Description |
---|---|---|---|
type | Required | String | Indicates the type of pipeline to register. Possible values are:
|
appId | Optional | String | Application ID |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the registered pipeline. |
returnValue | Optional | 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. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/registerPipeline '{
"type":"media"
}'
Response:
{
"connectionId": "_KXpMET1Sxc1eGO"
}
unregisterPipeline
Description
Unregisters pipeline with Resource Manager.
Note: This method is applicable to unmanaged pipelines only.
Parameters
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the pipeline to unregister. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/unregisterPipeline '{
"connectionId":"_KXpMET1Sxc1eGO"
}'
Response:
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_KXpMET1Sxc1eGO"
}
acquire
Description
Requests resources from the mediaserver. Typical usage is to request the number of audio and video decoders or other hardware components used by the pipeline. Acquire calls can be used to dynamically add more resources to the pipeline. This allows the pipeline to dynamically grow or shrink without monopolizing the resources from startup. Each time a resource is acquired, the indexes of the newly acquired resources are included in the acquireComplete event.
Note:
- The types and quantities of resources available to be managed are specified in the file umediaserver_resource_config.txt.in file.
- This file is customized for each hardware platform.
- If required to satisfy the acquisition of requested resources, a policyAction may be issued to other pipelines, forcing them to release their resources.
- For format and list of acquired resources see acquireComplete event.
Parameters
Name | Required | Type | Description |
---|---|---|---|
resources | Required | Object: resources | See "resources" object. |
connectionId | Required | String | Indicates the unique identifier of the pipeline to acquire resources. |
Call Returns
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. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/acquire '{
"resources": "[{\"resource\":\"DISP0\",\"qty\":1}, {\"resource\":\"VDEC\",\"qty\":1},{\"resource\":\"ADEC\",\"qty\":1}]",
"connectionId": "_UZRkgE3EJgXvwl"
}'
Response:
{
"returnValue": true
}
acquireComplete
{
"resources": [{
"qty": 1,
"resource": "ADEC",
"index": 3
}, {
"qty": 1,
"resource": "VDEC",
"index": 3
}, {
"qty": 1,
"resource": "DISP0",
"index": 3
}],
"state": true,
"connectionId": "_UZRkgE3EJgXvwl"
}
tryAcquire
Description
Tries to acquire resources from mediaserver.
Note:
- This API will not issue policyAction to other pipelines in order to force them to release resources.
- If there are insufficient resources to honor the request without issuing a policyAction, the request will fail.
Parameters
Name | Required | Type | Description |
---|---|---|---|
resources | Required | Object: resources | See "resources" object. |
connectionId | Required | String | Indicates the unique identifier of the pipeline to acquire resources. |
Call Returns
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. |
Example
Example code
# luna-send -n 1 luna://com.webos.media/tryAcquire '{
"resources": "[{\"resource\":\"DISP0\",\"qty\":1},{\"resource\":\"VDEC\",\"qty\":1},{\"resource\":\"ADEC\",\"qty\":1}]",
"connectionId": "_7P3y7e9AcPv8t1"
}'
Response:
{
"returnValue": true
}
acquireComplete
{
"resources": [{
"qty": 1,
"resource": "ADEC",
"index": 3
}, {
"qty": 1,
"resource": "VDEC",
"index": 3
}, {
"qty": 1,
"resource": "DISP0",
"index": 3
}],
"state": true,
"connectionId": "_7P3y7e9AcPv8t1"
}
release
Description
Informs media server the resources are released correctly and are not being used anymore.
Note: This method is applicable for unmanaged pipelines only.
Parameters
Name | Required | Type | Description |
---|---|---|---|
resources | Required | Object: resources | See "resources" object. |
connectionId | Required | String | Indicates the unique identifier of the pipeline to release resources. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of 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. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/release '{
"resources":"[{\"resource\":\"DISP0\",\"qty\":1,\"index\":3},{\"resource\":\"VDEC\",\"qty\":1,\"index\":3},{\"resource\":\"ADEC\",\"qty\":1,\"index\":3}]",
"connectionId":"_QY7tkX1XEfBct3"
}'
Response:
{
"returnValue": true
}
notifyActivity
Description
Notifies the media server that the specific pipeline is currently in use. This command raises the timestamp record of the corresponding pipeline to lessen the chance to be picked as the target for a policyAction, which would require the pipeline to release its resources.
Parameters
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the registered pipeline. |
Call Returns
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. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/notifyActivity '{
"connectionId":"_EYv0VPazu3aGo0"
}'
Response:
{
"returnValue": true
}
trackAppProcesses
Description
Subscribes to messages containing the mapping of application ID (appID) and pipeline process ID (PID), i.e. it returns information about which application each managed pipeline belongs to.The subscription messages contain information about changes to these mappings, i.e. new mappings when a pipeline is associated with an application or destroyed mappings when a pipeline exits.
Note: The return value of the method contains an array of the PIDs of all currently existing pipelines mapped to the corresponding appIDs.
Parameters
None
Call Returns
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Returns true if the subscriber was successfully added. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
mediaPipelines | Required | Object array: mediaPipelines | See "mediaPipelines" object. |
subscription | Required | Boolean | Indicates the current subscription status. Possible values are:
|
Subscription Returns
Name | Required | Type | Description |
---|---|---|---|
procUpdate | Required | Object: procUpdate | See "procUpdate" object. |
Example
Example code
# luna-send -n 2 -f luna://com.webos.media/trackAppProcesses '{}'
Response:
{
"subscription": true
}
{
"subscribed": true,
"mediaPipelines": [
{
"appId": "com.webos.app.enactbrowser",
"pid": 1685
}
],
"returnValue": true
}
Subscription Response:
{
"procUpdate":{
"appId":"com.webos.app.enactbrowser",
"exec":false,
"pid":1685
}
}
registerMedia
Description
Media Content Provider (unmanaged) must register with Media Display Controller to allow proper management of video content and displays or audio outputs.
NOTE: In managed case, this API is internally invoked from 'load' API. Thus, using this API with load is strongly discouraged.
(Duplicated calls for same mediaId are not allowed.)
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the media object to be registered |
appId | Required | String | Application ID |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of 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. |
mediaId | Optional | String | Unique identifier of the media object registered |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/registerMedia '{"mediaId":"_IsGbw614gu7xRB", "appId":"com.webos.app.enactbrowser"}'
Response:
{
"returnValue": true
}
unsubscribe
Description
Unsubscribes from media pipeline related events.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Optional | String | Indicates the unique identifier of the media object to unsubscribe. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline requested to unsubscribe. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/unsubscribe '{
"mediaId":"_gmkaR0OtGWxr6z"
}'
Response:
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_gmkaR0OtGWxr6z"
}
getActivePipelines
Description
Gets JSON formatted output of currently active media pipelines.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Optional | String | Indicates unique identifier of the media object. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
Id | Optional | String | Indicates unique identifier of the media object. |
type | Optional | String | Indicates the type of media. |
pid | Optional | Number (int16_t) | Indicates the process id of media content provider. |
is_managed | Optional | Boolean | Indicates whether media Content Provider is a managed pipeline or not.
|
is_foreground | Optional | Boolean | Indicates whether media object is currently in the foreground or not
|
mediaState | Optional | String | Indicates the current state of Media Content Provider. Possible values are:
|
policy_state | Optional | Boolean | Media is currently selected for Resource Management Policy Action and is in suspended state |
uri | Optional | String | Indicate the uri of media object. |
appId | Optional | String | Indicates the application id of application using media object. |
processState | Optional | String | Indicates the status of the media content provider process. Possible values are:
|
is_focus | Optional | String | Indicates that the media object is currently selected for focus. Note: Focus is not the same thing as "visible". |
timestamp | Optional | String | Indicates the timestamp of the last activity on Media Content Provider pipeline. Pipeline activity is used to adjust the Resource Manager Policy Action Candidate Selection Policy. Events which update pipeline activity are:
|
resources | Required | Object array: resources | See "resources" object. |
mediaId | Optional | String | Indicates mediaId of the object. |
errorCode | Optional | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Optional | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
returnValue | Optional | Boolean | Indicates the status of operation. Possible values are:
|
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/getActivePipelines '{}'
Response:
[
{
"pid":1521,
"resources":[
{
"resource":"ADEC",
"index":3
},
{
"resource":"VDEC",
"index":3
}
],
"type":"media",
"id":"_IzddeO9d8fP1jO",
"is_managed":true,
"mediaState":"play",
"is_foreground":true,
"policy_state":0,
"uri":"http://media.w3.org/2010/05/sintel/trailer.mp4",
"appId":"com.webos.app.enactbrowser",
"processState":"media_loaded",
"is_focus":false,
"timestamp":1423867226706,
"mediaId":"_IzddeO9d8fP1jO"
}
]
setVolume
Description
Sets the volume for the specified media object. Additionally, it specifies the ease (fade-in and fade-out) properties for the media object.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the media object. |
volume | Required | Number | The volume to be set. Can be set to any value between 0 and 100. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation.
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Unique identifier of the media object. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/setVolume '{"mediaId":"_IsGbw614gu7xRB","volume":60}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
getForegroundAppInfo
Description
Provides the application's foreground information.
Parameters
None
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
appId | Required | String | Indicates the application ID (appId). |
acbs | Required | Object array: acbs | Contains an array of objects that gives details of the media. (pipeline ID, playstate, position and so on) |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/getForegroundAppInfo '{}'
Response:
{
"acbs":[
{
"positionY":0,
"playStateNow":"",
"width":0,
"height":0,
"isFullScreen":false,
"pipelineId":"",
"positionX":0,
"playStateNext":""
}
],
"appId":"com.webos.app.enactbrowser",
"returnValue":true
}
setPlayRate
Description
Sets the pipeline media play rate.
Parameters
Name | Required | Type | Description |
---|---|---|---|
playRate | Required | Number (double) | Indicates the play back rate for the media. |
mediaId | Required | String | Indicates the unique identifier for the requested loaded media pipeline. |
audioOutput | Required | Boolean | Determine to mute audio |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the media object. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/setPlayRate '{
"playRate":2.0,
"mediaId":"_QnGGXr7BdWsOV1",
"audioOutput":true
}'
Response:
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_QnGGXr7BdWsOV1"
}
startCameraRecord
Description
Starts camera recording. Camera pipeline stores streamed data from the camera and microphone (if required) at the specified location.
Parameters
Name | Required | Type | Description |
---|---|---|---|
location | Required | String | Indicates the path for storing the recorded file. |
format | Required | String | Indicates the format in which data is stored. Possible values are:
|
mediaId | Required | String | Indicates the unique identifier of the camera pipeline obtained using the load() API. |
audio | Required | Boolean | Indicates whether the audio data from the microphone also has to be recorded along with video. Possible values are:
|
audioSrc | Required | String | Indicates the name of the microphone device from which the audio data has to be captured. Note: Supports only one audio source (pcm_input). |
Call Returns
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. Note: errorCode always defaults to 0. Details of the error will be available in the logs. |
errorText | Optional | String | Indicates the reason for the failure of the operation. Note: errorText is always empty. Details of the error will be available in the logs. |
mediaId | Required | String | Indicates the unique identifier of the camera pipeline. |
Example
Example : Camera recording without audio
# luna-send -n 1 luna://com.webos.media/startCameraRecord '{
"mediaId" :"_5nxnM2Xiw55PYS" ,
"location":"/media/internal/",
"format" :"MP4",
"audio":false,
"audioSrc":"pcm_input"
}'
Example : Camera recording with audio
# luna-send -n 1 luna://com.webos.media/startCameraRecord '{
"mediaId" :"_5nxnM2Xiw55PYS" ,
"location":"/media/internal/",
"format" :"MP4",
"audio":true,
"audioSrc":"pcm_input"
}'
stopCameraRecord
Description
Requests media server to stop camera recording and change to the preview state.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the camera pipeline obtained using the load() API. |
Call Returns
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. Note: errorCode always defaults to 0. Details of the error will be available in the logs. |
errorText | Optional | String | Indicates the reason for the failure of the operation. Note: errorText is always empty. Details of the error will be available in the logs. |
mediaId | Required | String | Indicates the unique identifier of the camera pipeline. |
Example
Example code
# luna-send -n 1 luna://com.webos.media/stopCameraRecord '{"mediaId":"_JtLZrGoEAoRa1d"}'
takeCameraSnapshot
Description
Captures a frame from the camera preview.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the camera pipeline which is obtained using the load() API. |
location | Required | String | Indicates the path of the captured image to be stored. |
format | Required | String | Indicates the format of the frame is to be captured. Possible values are:
|
width | Required | Number | Indicates the width of the captured image in pixels. Note: Width should be within the range supported by the camera hardware. |
height | Required | Number | Indicates the height of the captured image in pixels. Note: Height should be within the range supported by the camera hardware. |
pictureQuality | Required | Number | Indicates the percentage of the picture quality. Possible values are:
|
Call Returns
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. Note: errorCode always defaults to 0. Details of the error will be available in the logs. |
errorText | Optional | String | Indicates the reason for the failure of the operation. Note: errorText is always empty. Details of the error will be available in the logs. |
mediaId | Required | String | Indicates the unique identifier the camera pipeline. |
Example
Example code
# luna-send -n 1 luna://com.webos.media/takeCameraSnapshot '{
"mediaId":"",
"location":"/tmp/",
"format":"jpg",
"width":640,
"height":480,
"pictureQuality":30
}'
notifyPipelineStatus
Description
Notifies the playback status of media pipelines.
Parameters
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the media pipeline. |
pipelineStatus | Optional | String | Indicates the pipeline status. Possible values are:
|
pid | Optional | Number | Indicates the Process ID of the pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of 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. |
Example
Example code
# luna-send -n 1 -f luna://com.webos.media/notifyPipelineStatus '{"connectionId":"_gu6P54bK8fkGgo","pipelineStatus":"pause","pid":3190}'
Response:
{
"returnValue": true
}
getDisplayId
Description
Gets information about the display on which the specified application instance is launched.
Note: This method supports multi-screen playback.
Parameters
Name | Required | Type | Description |
---|---|---|---|
instanceId | Required | String | Indicates the unique identifier of the application instance. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
displayId | Optional | Number | Indicates the identifier of the display used. |
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. |
Example
Example: For application launched in primary screen
# luna-send -n 1 -f luna://com.webos.media/getDisplayId '{"instanceId": "9582089b-3a1c-4a37-acf8-83df8d1b6eec0"}'
Response:
{
"displayId": 0,
"returnValue": true
}
Example: For application launched in secondary screen
# luna-send -n 1 -f luna://com.webos.media/getDisplayId '{"instanceId": "df6d8057-611d-4080-b5ba-0de59f2a40210"}'
Response:
{
"displayId": 1,
"returnValue": true
}
getPipelineState
Description
Requests the media server to retrieve pipeline state information.
Parameters
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Call Returns
Name | Required | Type | Description |
---|---|---|---|
errorCode | Required | Number | The error code for the operation. Returns 0 when the returnValue is true and returns '-1' if JSON parsing fails. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Required | String | Indicates the reason for the failure of the operation. Returns "No Error" if there is no failure. |
data | Optional | Object: data | Pipeline state information. |
mediaId | Optional | String | Media ID of the object. |
Example
Example scenario
# luna-send -n 2 -f luna://com.webos.media/getPipelineState '{"mediaId":"_pwvgD9ivrcVkYV"}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"data":"{\"seekPos\":0,\"loadCompleted\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"currentTime\":52249,\"seekDone\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"bufferingEnd\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"videoInfo\":{\"video\":{\"codec\":0,\"width\":854,\"frame_rate\":{\"num\":0,\"den\":1},\"bitrate\":0,\"height\":480}},\"mediaState\":\"play\",\"subscription\":true,\"endOfStream\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"bufferingStart\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"playing\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"bufferRange\":{\"beginTime\":52249,\"endTime\":52,\"remainingTime\":1,\"percent\":100},\"procState\":\"media_loaded\",\"sourceInfo\":{\"audio_streams\":[{\"codec\":0,\"sample_rate\":48000,\"bit_rate\":80000}],\"duration\":52250,\"programs\":[{\"video_stream\":1,\"audio_stream\":1}],\"video_streams\":[{\"video\":{\"codec\":0,\"width\":854,\"frame_rate\":{\"num\":0,\"den\":1},\"bitrate\":0,\"height\":480}}],\"container\":\"\",\"seekable\":true}}",
"mediaId":"_pwvgD9ivrcVkYV"
}
reacquire
Description
Dynamically adds more resources to the pipeline.
Parameters
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | The unique identifier of the pipeline to add resources. |
resources | Required | Object: resources_new | Resource list to be allocated. |
Call Returns
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 | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
Error Codes Reference
Error Code | Error Text | Error Description |
---|---|---|
-1 | Method "reacquire" for category "/" was not handled | In case of invalid argument scenarios, this error will be returned. |
Example
Example scenario
# luna-send -n 1 -f luna://com.webos.media/reacquire '{
"connectionId": "_dqEYC2bXztCwsj",
"resources":"{
\"new\":\"[{\\\"qty\\\":3,\\\"resource\\\":\\\"VDEC\\\"}]\",
\"old\":\"[{\\\"index\\\":31,\\\"resource\\\":\\\"VDEC\\\"}]\"}"
}'
Response:
{
"returnValue": true
}
Objects
ResponseObject
Provides a detailed description of the object. Limit to 2-3 paragraphs.
Name | Required | Type | Description |
---|---|---|---|
returnValue | Optional | Boolean | Return value of command. Command succeeded true/false. |
errorCode | Optional | Number | Error Code (if failure) of command. |
errorText | Optional | String | Human readable and HMI/UX displayable text of reported error. If any. |
mediaId | Optional | String | Media ID |
resources
Object of resource name, quantity, and index.
Resources can hold more than one set of resource, quantity, and index.
Example:
{
"resources": " [{
"resource": "DISP0",
"qty": 1,
"index": 3,
},
{
"resource": "VDEC",
"qty": 1,
"index": 3
},
{
"resource": "ADEC",
"qty": 1,
"index": 3
}
]
}
Name | Required | Type | Description |
---|---|---|---|
qty | Optional | Number | Quantity of resource to acquire. |
index | Optional | Number | Specific index of resource to acquire. |
resource | Optional | String | Name of resource to acquire. Possible values are:
|
videoInfo
Provides information related to video.
Name | Required | Type | Description |
---|---|---|---|
width | Required | Number (uint32_t) | Actual width value of input video (before cropping in video decoder. Used for UI presentation.) |
height | Required | Number (uint32_t) | Actual height value of input video (before cropping in video decoder. Used for UI presentation.) |
frameRate | Required | Object: frameRate | See "frameRate" object. |
codec | Optional | String | Codec information. |
bitRate | Optional | Number (uint64_t) | Bit rate value of content. |
frameRate
Provides information about the number of frames per second at which the video is being played.
It is represented as a combination of numerator and denominator.
Name | Required | Type | Description |
---|---|---|---|
num | Required | Number (int32_t) | Numerator of frame rate |
den | Required | Number (int32_t) | Denominator of frame rate |
audioInfo
Provides information related to audio.
Name | Required | Type | Description |
---|---|---|---|
codec | Optional | String | Codec information |
bitrate | Optional | Number (int64_t) | Bit rate value of content. |
sample_rate | Optional | Number (int32_t) | Samples of audio carried per second, measured in kHz. |
mediaPipelines
Contains the AppID-PID mapping of the currently running pipelines. Returns an empty array if no pipelines associated with any applications.
Each array element is an object of type {"appId": string, "pid": number}. If the appId string is empty it means the pipeline was loaded without an application ID being provided.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Indicates application id |
pid | Required | Number | Indicates process id of pipeline |
procUpdate
The procUpdate object value is an object of type: {"appId" : string, "exec" : bool, "pid" : number}
where exec is true when a pipeline appid mapping is added and false when it is destroyed.
If the appId string is empty it means the pipeline was loaded without an application ID being provided.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Indicates application ID. |
pid | Required | Number | Indicates process ID of pipeline. |
exec | Required | Boolean | Provides information on the mapping status of app ID and a pipeline. Possible values are:
|
payload
Payload format used in load API. It represents the JSON payload object for a specific type of pipeline.
Name | Required | Type | Description |
---|---|---|---|
option | Optional | Object: option | See "option" object. |
option
Provides parameters used in the load/preload API.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Indicates the application id. |
windowId | Required | String | Indicates the windowId attached to the video sink. The value should be specified in the format: "_Window_Id_X" (X is number). Note: The value should be given by the surface manager before the load API is called. |
videoDisplayMode | Optional | String | Indicates the display mode of the pipeline. Default: Textured Note: Only Textured value is supported. |
display-path | Optional | Number | Indicates the display path. Default: 0 Note:
|
width | Optional | Number | Indicates the width of the image to be taken from the camera device. The value can vary from supported width of the image. Note: This is required when load API is used for the camera. |
height | Optional | Number | Indicates the height of the image to be taken from the camera device. The value can vary from supported height of the image. Note: This is required when the load API is used for the camera. |
format | Optional | String | Indicates the type of the camera data to be taken from the camera device. Possible values are:
Note: This is required when the load API is used for the camera. |
frameRate | Optional | Number | Indicates the number of frames captured per sec from a camera device. Based on the camera supported values, provide the frameRate such as 30 / 15 and so on. Note: This is required when the load API is used for the camera. |
memType | Optional | String | Indicates the type of access with camera device. Possible values are:
Note: This is required when the load API is used for the camera. |
memSrc | Optional | String | Indicates the source of the camera data. Possible value: Device node like "/dev/video0" / shared memory key "7010" ( which is returned by camera service ). Note: This is required when the load API is used for the camera. |
handle | Optional | Number | Indicates the handle for the device obtained using the open() API of camera service. This parameter is required only when "memType" is "posixshm" for camera functionality. |
iomode | Optional | Number | Represents the memory mode value which are defined using an enum like mmap, user pointer & dma buffer, when "memType" is "device" for camera functionality. Possible values are:
|
programs
Provides audio/video stream information.
Name | Required | Type | Description |
---|---|---|---|
video_stream | Required | Number (int32_t) | The number of video streams in program. |
audio_stream | Required | Number (int32_t) | The number of audio streams in program. |
sourceInfo
Provides information of the media that has just been loaded.
Example:
{
"sourceInfo": {
"programs": [{
"audio_stream": 1,
"video_stream": 1
}],
"seekable": true,
"video_streams": [{
"width": 854,
"frame_rate": {
"num": 24,
"den": 1
},
"bitrate": 535929,
"height": 480
}],
"audio_streams": [{
"sample_rate": 48000,
"bit_rate": 0
}],
"container": "",
"duration": 52209
}
}
Name | Required | Type | Description |
---|---|---|---|
programs | Required | Object array: programs | See "programs" object. |
seekable | Required | Boolean | Flag indicating whether the media supports seek operations.
|
video_streams | Required | Object array: videoInfo | See "videoInfo" object. |
audio_streams | Required | Object array: audioInfo | See "audioInfo" object. |
container | Optional | String | Media format (container type) of source
|
duration | Required | Number (int64_t) | Total duration in milli-seconds of the program. |
display_attr
Provides detailed information for display resource.
Name | Required | Type | Description |
---|---|---|---|
crtc-id | Required | Number (int32_t) | Crtc id of display |
plane-id | Required | Number (uint32_t) | Plane id of display |
conn-id | Required | Number (int32_t) | Connector id of display |
acbs
Array of objects that gives details of media for foreground application (such as pipeline Id, playstate, position, etc.)
Name | Required | Type | Description |
---|---|---|---|
pipelineId | Required | String | Pipeline id |
playStateNow | Required | String | Current playback status |
playStateNext | Required | String | Next playback status |
isFullScreen | Required | Boolean | Specifies if the app is in full screen mode. |
positionX | Required | Number (int32_t) | X Position of window |
positionY | Required | Number (int32_t) | Y Position of window |
width | Required | Number (int32_t) | Width of the app window. |
height | Required | Number (int32_t) | Height of the app window. |
data
Provides information related to the current state of the pipeline.
Name | Required | Type | Description |
---|---|---|---|
endOfStream | Optional | Object: mediaId | Indicates if the pipeline has reached the end of stream. |
loadCompleted | Optional | Object: mediaId | Indicates whether the pipeline is in the loaded state. |
currentTime | Optional | Number (int64_t) | Current time at which the media is being played. |
bufferingEnd | Optional | Object: mediaId | Indicates pipeline is in play state after filling buffers. |
bufferingStart | Optional | Object: mediaId | Indicates pipeline is temporarily paused internally in order to buffer more data. |
videoInfo | Optional | Object: videoInfo | Video information. |
sourceInfo | Optional | Object: sourceInfo | Source information. |
subscription | Required | String | Indicates if events are subscribed for the pipeline with subscribe method. Possible values are:
|
mediaState | Required | String | Pipeline playback state. Possible values are:
|
procState | Required | String | Media Pipeline process state. Possible values are:
|
bufferRange | Optional | Object | See "bufferRange" event parameters |
playing | Optional | Object: mediaId | Indicates if the pipeline is playing. |
paused | Optional | Object: mediaId | Indicates if the pipeline is paused. |
seekDone | Optional | Object: mediaId | Indicates seek request is completed. |
seekPos | Optional | Number (int64_t) | Position to which seek is done. |
mediaId
Unique identifier of the loaded media/camera pipeline.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates mediaId of the object. |
resources_new
Object indicating the new and old resource.
Name | Required | Type | Description |
---|---|---|---|
old | Required | Object: ResourceDetails | The resources to be released. |
new | Required | Object: ResourceDetails | The resources to be acquired. |
ResourceDetails
Details of the resource.
Name | Required | Type | Description |
---|---|---|---|
resource | Required | String | Name of resource to acquire. Possible values are:
|
qty | Optional | Number | Quantity of resources to acquire. Note: Only applicable for the resource to be acquired. |
index | Optional | Number | Specific index of resources to be released. Note: Only applicable for the resource to be released. |
Signals/Events
loadCompleted
The loadCompleted event is raised when a specific media pipeline has been successfully loaded.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | Number | Unique identifier of the loaded pipeline. |
unloadCompleted
The unloadCompleted event is raised when a specific media pipeline has been successfully unloaded.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | Number | Unique identifier of the unloaded pipeline. |
detached
The detached event is raised when a specific media has been detached from the client by another client attaching to the corresponding pipeline. The detached event is related to the attach command. Attach allows to transfer the control of a pipeline to be handed over to a different client. When that happens the original client gets notified that it got detached from the pipeline and is hence no longer able to control the pipeline. This feature is related to fast boot scenarios where we have a mini-app controlling media upon initial launch and the control is handed over to the real/full application once the system has started in full.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Optional | Number | Unique identifier of detached pipeline. |
seekDone
The seekDone event is raised when a seek operation for a media has been successfully completed.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | Number | Unique identifier of the requested pipeline to seek. |
playing
The playing event is raised once, in response to the play method, when a specified media pipeline has transitioned into the playing state.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | Number | Unique identifier of the requested pipeline to play. |
paused
The paused event is raised when a specific media has been successfully paused.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | Number | Unique identifier of the requested pipeline to pause. |
endOfStream
The endOfStream event is raised when a specific media has received all of its data.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | Number | Unique identifier of pipeline met end of stream. |
currentTime
The currentTime event is raised multiple times when a specific media is playing. It indicates the progress of the media being played and provides the current time at which the media is being played.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
currentTime | Required | Number | Current time at which the media is being played. |
mediaId | Required | Number | Unique identifier of pipeline which reports current time. |
sourceInfo
The sourceInfo event provides information about the media that has just been loaded.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
sourceInfo | Required | Object: sourceInfo | See "sourceInfo" object. |
videoInfo
The videoInfo event provides information related to video.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
videoInfo | Required | Object: videoInfo | See "videoInfo" object. |
audioInfo
The audioInfo event provides information related to audio.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
audioInfo | Required | Object: audioInfo | See "audioInfo" object. |
error
The error event reports errors thrown by pipelines.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | Error code from the service. |
errorText | Optional | Number | Error code description from the service. |
mediaId | Required | Number | Unique identifier of pipeline sending error information. |
acquireComplete
The acquireCompete event is invoked when the acquire request is performed and the result comes out.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
resources | Required | Number | See "resources" object. |
state | Required | Number | Flag indicating the result of acquire request.
|
connectionId | Required | Number | Unique identifier of the pipeline to acquire resource. |
policyAction
The policyAction event is invoked when the resources are short of quantity to playing new media content and request pipeline to release regarding resource.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
requestor_type | Required | Number | Type of pipeline that made a new request. This is the pipeline requesting the additional resources. |
requestor_name | Required | Number | Name of pipeline that made new request. This is the pipeline requesting additional resources. |
action | Required | Number | Action requested to do at the pipeline when this policyAction is delivered. |
resources | Required | Number | See "resources" object. |
connectionId | Required | Number | Unique identifier of the pipeline to get policyAction event |
bufferRange
Indicates the buffering range of the particular media content. It is raised multiple times when specific media is loaded.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
beginTime | Required | Number | Starting time of the bufferRange of the media. |
endTime | Required | Number | End time of the bufferRange of the media. |
mediaId | Required | Number | Unique identifier of pipeline reports bufferRange. |
percent | Required | Number | Percent of the total buffer the current buffer range represents. |
bufferingStart
Indicates the pipeline is temporarily pausing playback internally in order to buffer more data.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | Number | Unique identifier of the pipeline that starts buffering. |
bufferingEnd
Indicates the pipeline is resuming playback after filling buffers.
Call Returns
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | Number | Unique identifier of the pipeline that buffering is complete. |
API Error Codes Reference
Error Code | Error Text | Error Description |
---|---|---|
600 | PolicyAction | Media related errors reported by the media pipeline are reported into several categories.
|
601 | Resource Allocation Error | Media related errors reported by the media pipeline are reported into several categories.
|