com.webos.service.mediaindexer

Note
This API has been available since API level 12.

API Summary

Provides the functionalities that scan media files (audios, videos, images) from internal / external storage devices such as the usb devices and extracts the meta data.

Overview of the API

For connected storage devices, detects media contents and extracts meta data. External services using API provided by the service can be informed when the status of connected devices or media contents are changed. Information of connected devices and media contents is also stored in DB via com.webos.mediadb.

Currently supported type of devices are as follows:

  • Internal storage devices
  • USB devices

Methods

getAudioList

ACG: mediaindexer.operation
  • Added: API level 12

Description

Gets the available audio file list included in attached devices.

Note: If the uri is specified, the audio file list for specified uri is provided. Else the audio file list for all attached devices is provided.

Parameters

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target that contains the source path of the audio files.

The format is given as: <protocol name>://<device uuid>

Example: msc://D94A-BE4D

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

Note: Notifications are not provided when an entry is removed from the list (physical devices are detached). In this case, the user is notified from other external service such as physical device manager.

countOptionalNumber

Limits the number of entries in the returned audio file list.

Default: 500

Call Returns

Name

Required

Type

Description

audioListOptionalObject: audioList

Indicates the supported device types.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation. 

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

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.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorTextOptionalString

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.

errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

audioListOptionalObject: audioList

Specifies supported device types.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Example

Example: With uri

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getAudioList '{"uri":"msc://D94A-BE4D"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": {
      "results": [
         {
            "last_modified_date": "Thu Jul 30 06:48:04 2020 GMT",
            "duration": 10,
            "file_path": "file:///tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
            "album": "Test Album",
            "genre": "Classical",
            "artist": "Test Artist",
            "title": "Test Name",
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
            "file_size": 184861,
            "thumbnail": "/media/.thumbnail/D94A-BE4D/9513454098549223.jpg"
         }
      ],
      "uri": "msc://D94A-BE4D",
      "count": 1
   }
}

Example: With subscription

# luna-send -i -f luna://com.webos.service.mediaindexer/getAudioList '{"subscribe":true}'

Response :

{
   "subscribed": true,
   "returnValue": true
}

Subscription response: 

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": [
      {
         "results": [
            {
               "last_modified_date": "Tue Nov 25 06:10:08 2014 GMT",
               "duration": 260,
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/01_Jalsa.mp3",
               "album": "Jalsa - (2008)",
               "genre": "Telugu",
               "artist": "Baba Sehgal, Rita",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/01_Jalsa.mp3",
               "title": "[iSongs.info] 01 - Jalsa",
               "file_size": 4243260,
               "thumbnail": "/media/.thumbnail/D7FE-42B8/8257472925753254.jpg"
            },
            {
               "last_modified_date": "Mon Sep 14 05:53:28 2020 GMT",
               "duration": 226,
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/albumart/Miss_A.mp3",
               "album": "TestAlbum",
               "genre": "Telugu",
               "artist": "Miss A",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/albumart/Miss_A.mp3",
               "title": "Good Bye Baby",
               "file_size": 5453302,
               "thumbnail": "/media/.thumbnail/D7FE-42B8/1208322061333152.jpg"
            }
         ],
         "count": 2
      }
   ]
}

Example: With subscription and count limitation

# luna-send -i -f luna://com.webos.service.mediaindexer/getAudioList '{
   "subscribe":true,
   "count":1
}'

Response:

{
   "subscribed": true,
   "returnValue": true
}

Subscription response 1:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": {
      "results": [
         {
            "last_modified_date": "Tue Nov 25 06:10:08 2014 GMT",
            "duration": 260,
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/01_Jalsa.mp3",
            "album": "Jalsa - (2008)",
            "genre": "Telugu",
            "artist": "Baba Sehgal, Rita",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/01_Jalsa.mp3",
            "title": "[iSongs.info] 01 - Jalsa",
            "file_size": 4243260,
            "thumbnail": "/media/.thumbnail/D7FE-42B8/479067904926436.jpg"
         }
      ],
      "count": 1
   }
}

Subscription response 2:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": {
      "results": [
         {
            "last_modified_date": "Mon Sep 14 05:53:28 2020 GMT",
            "duration": 226,
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/albumart/Miss_A.mp3",
            "album": "TestAlbum",
            "genre": "Telugu",
            "artist": "Miss A",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/albumart/Miss_A.mp3",
            "title": "Good Bye Baby",
            "file_size": 5453302,
            "thumbnail": "/media/.thumbnail/D7FE-42B8/106457924970666.jpg"
         }
      ],
      "count": 1
   }
}

Example: Without uri

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getAudioList '{}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": {
      "results": [
         {
            "last_modified_date": "Wed Jul 22 09:09:38 2020 GMT",
            "duration": 348,
            "file_path": "file:///tmp/usb/sdh/sdh1/Sample-OGG-File.ogg",
            "album": "Ninja Tuna",
            "genre": "Electronic",
            "artist": "Mr. Scruff",
            "title": "Kalimba",
            "uri": "msc://B5E0-BBB2/tmp/usb/sdg/sdg1/Sample-OGG-File.ogg",
            "file_size": 6984260,
            "thumbnail": ""
         },
         {
            "last_modified_date": "Thu Jul 30 06:48:04 2020 GMT",
            "duration": 10,
            "file_path": "file:///tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
            "album": "Test Album",
            "genre": "Classical",
            "artist": "Test Artist",
            "title": "Test Name",
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
            "file_size": 184861,
            "thumbnail": "/media/.thumbnail/D94A-BE4D/9513454098549223.jpg"
         }
      ],
      "count": 2
   }
}

getAudioMetadata

ACG: mediaindexer.operation
  • Added: API level 12

Description

Gets the detailed meta data information of the specified uri for the given audio file.

Parameters

Name

Required

Type

Description

uriRequiredString

Indicates the uri of the audio file.

Example: msc://D94A-BE4D/tmp/usb/sdg/sdg1/SampleAudio.mp3

Call Returns

Name

Required

Type

Description

metadataOptionalObject array: AudioMetadata

Indicates the meta data information of specified audio file.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

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.

Example

Example: With uri

# luna://com.webos.service.mediaindexer/getAudioMetadata '{"uri":"msc://D94A-BE4D/tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3"}'

Response: 

{
   "errorCode": 0,
   "returnValue": true,
   "metadata": {
      "sample_rate": 44100,
      "file_path": "file:///tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
      "track": "3/4",
      "date_of_creation": "2008-12-29",
      "genre": "Classical",
      "duration": 10,
      "last_modified_date": "Thu Jul 30 06:48:04 2020 GMT",
      "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
      "album": "Test Album",
      "type": "audio",
      "thumbnail": "/media/.thumbnail/D94A-BE4D/4470986424276816.jpg",
      "bit_rate": 110,
      "hash": "13605171757709551616",
      "title": "Test Name",
      "dirty": false,
      "artist": "Test Artist",
      "mime": "audio/mpeg",
      "total_tracks": "",
      "file_size": 184861,
      "channels": 2,
      "album_artist": "Test Album Artist",
      "bit_per_sample": "",
      "lyric": ""
   },
   "errorText": "No Error"
}

getDeviceList

ACG: mediaindexer.operation
  • Added: API level 12

Description

Gets the list of all the attached storage devices.

Note: The list can contain devices that are currently attached or the devices attached in the past.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribe for notifications.
  • false: Not subscribed

Default: false

Call Returns

Name

Required

Type

Description

pluginListRequiredObject array: pluginList

Indicates the supported device types.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

pluginListRequiredObject array: pluginList

Indicates the supported device types.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true:  Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Example

Example: With subscription

# luna-send -n 2 -f luna://com.webos.service.mediaindexer/getDeviceList '{"subscribe":true}'

Response:

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
    "returnValue": true,
    "pluginList": [
        {
            "uri": "msc",
            "deviceList": [
                {
                    "videoCount": 14,
                    "available": true,
                    "state": "idle",
                    "audioCount": 17,
                    "name": "SanDisk 3.2Gen1",
                    "description": "SanDisk 3.2Gen1",
                    "imageCount": 6,
                    "uri": "msc://4CA3-8283"
                }
            ],
            "active": true
        },
        {
            "uri": "storage",
            "deviceList": [
                {
                    "videoCount": 0,
                    "available": true,
                    "state": "idle",
                    "audioCount": 0,
                    "name": "Media",
                    "description": "Local Media Storage",
                    "imageCount": 0,
                    "uri": "storage:///media/multimedia"
                }
            ],
            "active": true
        }
    ]
}
 

getImageList

ACG: mediaindexer.operation
  • Added: API level 12

Description

Gets all the available image file list included in the attached devices.

Note: If the uri is specified, the image file list for specified uri is provided. Else the image file list for all attached devices is provided.

Parameters

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target that contains the source path of the image files.

Format: <protocol name>://<device uuid>.

Example: msc://D94A-BE4D

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

Note: Notifications are not provided when an entry is removed from the list (physical devices are detached). In this case, the user is notified from other external service such as physical device manager.

countOptionalNumber

Limits the number of entries in the returned image file list.

Default: 500

Call Returns

Name

Required

Type

Description

imageListOptionalObject: imageList

Specifies the supported device types. See imageList for details.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

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.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
errorTextOptionalString

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.

errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

imageListOptionalObject: imageList

Indicates the supported device types. See imageList for details.

Example

Example: Without uri

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getImageList '{}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "imageList": {
      "results": [
         {
            "width": 1024,
            "last_modified_date": "Fri Aug 14 03:54:08 2020 GMT",
            "uri": "msc://B5E0-BBB2/tmp/usb/sdg/sdg1/image/SampleImage1.jpg",
            "title": "SampleImage1",
            "file_size": 197377,
            "height": 768,
            "file_path": "file:///tmp/usb/sdg/sdg1/image/SampleImage1.jpg"
         },
         {
            "width": 1024,
            "last_modified_date": "Wed Jul 22 09:04:16 2020 GMT",
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleImage2.jpg",
            "title": "SampleImage2",
            "file_size": 199429,
            "height": 768,
            "file_path": "file:///tmp/usb/sdh/sdh1/SampleImage2.jpg"
         }
      ],
      "count": 2
   }
}

Example: With uri

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getImageList '{"uri":"msc://D94A-BE4D"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "imageList": {
      "results": [
         {
            "width": 1024,
            "last_modified_date": "Wed Jul 22 09:04:16 2020 GMT",
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleImage2.jpg",
            "title": "SampleImage2",
            "file_size": 199429,
            "height": 768,
            "file_path": "file:///tmp/usb/sdh/sdh1/SampleImage2.jpg"
         }
      ],
      "uri": "msc://D94A-BE4D",
      "count": 1
   }
}

Example: With subscription

# luna-send -i -f luna://com.webos.service.mediaindexer/getImageList '{"subscribe":true}'

Response:

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "imageList": [
      {
         "results": [
            {
               "width": 350,
               "last_modified_date": "Thu Jul 14 07:05:32 2016 GMT",
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/scan1/Apink_ Promise U.jpg.jpg",
               "height": 196,
               "file_size": 56228,
               "title": "Apink_ Promise U.jpg",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/scan1/Apink_ Promise U.jpg.jpg"
            },
            {
               "width": 3092,
               "last_modified_date": "Mon Sep 14 02:06:24 2020 GMT",
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/thorsmork.jpg",
               "height": 1616,
               "file_size": 1060326,
               "title": "thorsmork",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/thorsmork.jpg"
            }
         ],
         "count": 2
      }
   ]
}

Example: With subscription and count limitation

# luna-send -i -f luna://com.webos.service.mediaindexer/getImageList '{
   "subscribe":true,
   "count":1
}'

Response :

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "imageList": {
      "results": [
         {
            "width": 350,
            "last_modified_date": "Thu Jul 14 07:05:32 2016 GMT",
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/scan1/Apink_ Promise U.jpg.jpg",
            "height": 196,
            "file_size": 56228,
            "title": "Apink_ Promise U.jpg",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/scan1/Apink_ Promise U.jpg.jpg"
         }
      ],
      "count": 1
   }
}

getImageMetadata

ACG: mediaindexer.operation
  • Added: API level 12

Description

Gets the detailed meta data information of specified uri of the image file.

Parameters

Name

Required

Type

Description

uriRequiredString

Indicates the uri of the audio file.

Example: msc://D94A-BE4D/tmp/usb/sdg/sdg1/SampleImage.jpg

Call Returns

Name

Required

Type

Description

metadataOptionalObject array: imageList

Indicates the metadata information of specified audio file.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

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.

Example

Example: With uri

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getImageMetadata '{"uri":"msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleImage2.jpg"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "metadata": {
      "date_of_creation": "",
      "geo_location_city": "",
      "last_modified_date": "Wed Jul 22 09:04:16 2020 GMT",
      "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleImage2.jpg",
      "height": 768,
      "type": "image",
      "hash": "13604488729709551616",
      "title": "SampleImage2",
      "width": 1024,
      "dirty": false,
      "mime": "image/jpeg",
      "file_path": "file:///tmp/usb/sdh/sdh1/SampleImage2.jpg",
      "geo_location_latitude": "",
      "geo_location_longitude": "",
      "geo_location_country": "",
      "file_size": 199429
   },
   "errorText": "No Error"
}

getMediaDbPermission

ACG: mediaindexer.operation
  • Added: API level 12

Description

Enables the external services or applications to acquire, access permission of the DB managed by the media indexer service.

Parameters

Name

Required

Type

Description

serviceNameRequiredString

Indicates the name of the external services or the applications to access the DB of the media indexer service.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Example

Example: With serviceName

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getMediaDbPermission '{"serviceName":"com.webos.mediaindexer.app.qml"}'

Response:

{
   "returnValue":true
}

Example: Without service name

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getMediaDbPermission '{}'

Response:

{
   "errorCode":-1,
   "returnValue":false,
   "errorText":"serviceName field is mandatory input"
}

getPlugin

ACG: mediaindexer.devutility
  • Added: API level 24

Description

Requests to retrieve the plugin from the plugin factory and to then activate the plugin.

Parameters

Name

Required

Type

Description

uriOptionalString

URI of the plugin to be retrieved and activated.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation is successful.
  • false: Indicates that the operation has failed.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Error Codes Reference

Error Code

Error Text

Error Description

-1Method "getPlugin" for category "/" was not handled

Method was not executed due to invalid input.

Example

Example scenario

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getPlugin '{"uri": "mtp"}'

Response:

{
    "returnValue": true
}

getPluginList

ACG: mediaindexer.devutility
  • Added: API level 24

Description

Gets a list of available plugins.

Parameters

None

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation. Always returns true.

pluginListOptionalObject array: pluginList

Contains list of all installed plugins.

Example

Example scenario

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getPluginList '{}'

Response:

{
   "returnValue":true,
   "pluginList":[
      {
         "uri":"mtp"
      },
      {
         "uri":"upnp"
      },
      {
         "uri":"msc"
      },
      {
         "uri":"storage"
      }
   ]
}

getVideoList

ACG: mediaindexer.operation
  • Added: API level 12

Description

Gets the available video files list included in the attached devices.

Note: If the uri is specified, the video file list for specified uri is provided. Else the video file list for all attached devices is provided.

Parameters

Name

Required

Type

Description

uriOptionalString

Specifies uri of device mounted on target that provided video files belongs to.

Format: <protocol name>://<device uuid>.

Example: msc://D94A-BE4D

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

Note: Notifications are not provided when an entry is removed from the list (physical devices are detached). In this case, the user is notified from other external service such as physical device manager.

countOptionalNumber

Limits the number of entries in the returned video file list.

Default: 500

Call Returns

Name

Required

Type

Description

videoListOptionalObject: videoList

Indicates the supported device types.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

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.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
errorTextOptionalString

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.

errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

videoListOptionalObject: videoList

Indicates the supported device types.

Example

Example: Without uri

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getVideoList '{}'

Response: 

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": {
      "results": [
         {
            "width": 1920,
            "duration": 205,
            "file_path": "file:///tmp/usb/sdg/sdg1/video/SampleVideofiles1.mp4",
            "last_modified_date": "Fri Aug 14 03:55:22 2020 GMT",
            "thumbnail": "/media/.thumbnail/B5E0-BBB2/1716759322466815.jpg",
            "height": 1080,
            "file_size": 264881271,
            "uri": "msc://B5E0-BBB2/tmp/usb/sdg/sdg1/video/SampleVideofiles1.mp4",
            "title": "SampleVideofiles1"
         },
         {
            "width": 1920,
            "duration": 209,
            "file_path": "file:///tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
            "last_modified_date": "Wed Jul 22 09:07:16 2020 GMT",
            "thumbnail": "/media/.thumbnail/D94A-BE4D/3810749630515133.jpg",
            "height": 1080,
            "file_size": 268264916,
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
            "title": "SampleVideofiles2"
         }
      ],
      "count": 2
   },
   "errorText": "No Error"
}

Example: With uri

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getVideoList '{"uri":"msc://D94A-BE4D"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": {
      "results": [
         {
            "width": 1920,
            "duration": 209,
            "file_path": "file:///tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
            "last_modified_date": "Wed Jul 22 09:07:16 2020 GMT",
            "thumbnail": "/media/.thumbnail/D94A-BE4D/1176055898542105.jpg",
            "height": 1080,
            "file_size": 268264916,
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
            "title": "SampleVideofiles2"
         }
      ],
      "uri": "msc://D94A-BE4D",
      "count": 1
   },
   "errorText": "No Error"
}

Example: With subscription

# luna-send -i -f luna://com.webos.service.mediaindexer/getVideoList '{"subscribe":true}'

Response :

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": [
      {
         "results": [
            {
               "last_modified_date": "Mon Nov  5 23:48:20 2018 GMT",
               "duration": 9,
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/SampleVideo_360x240_1mb.mkv",
               "thumbnail": "/media/.thumbnail/D7FE-42B8/1268526786254962.jpg",
               "height": 240,
               "file_size": 1055721,
               "title": "SampleVideo_360x240_1mb",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/SampleVideo_360x240_1mb.mkv",
               "width": 320
            },
            {
               "last_modified_date": "Mon Nov  5 23:48:20 2018 GMT",
               "duration": 9,
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/scan1/SampleVideo_360x240_1mb.mkv",
               "thumbnail": "/media/.thumbnail/D7FE-42B8/1123462817394724.jpg",
               "height": 240,
               "file_size": 1055721,
               "title": "SampleVideo_360x240_1mb",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/scan1/SampleVideo_360x240_1mb.mkv",
               "width": 320
            }
         ],
         "count": 2
      }
   ],
   "errorText": "No Error"
}

Example: With subscription and count limitation

# luna-send -i -f luna://com.webos.service.mediaindexer/getVideoList '{
   "subscribe":true,
   "count":1
}'

Response :

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": {
      "results": [
         {
            "last_modified_date": "Mon Nov  5 23:48:20 2018 GMT",
            "duration": 9,
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/SampleVideo_360x240_1mb.mkv",
            "thumbnail": "/media/.thumbnail/D7FE-42B8/685728599232055.jpg",
            "height": 240,
            "file_size": 1055721,
            "title": "SampleVideo_360x240_1mb",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/SampleVideo_360x240_1mb.mkv",
            "width": 320
         }
      ],
      "count": 1
   },
   "errorText": "No Error"
}

Subscription response 2:

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": {
      "results": [
         {
            "last_modified_date": "Mon Nov  5 23:48:20 2018 GMT",
            "duration": 9,
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/scan1/SampleVideo_360x240_1mb.mkv",
            "thumbnail": "/media/.thumbnail/D7FE-42B8/677091961220339.jpg",
            "height": 240,
            "file_size": 1055721,
            "title": "SampleVideo_360x240_1mb",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/scan1/SampleVideo_360x240_1mb.mkv",
            "width": 320
         }
      ],
      "count": 1
   },
   "errorText": "No Error"
}

getVideoMetadata

ACG: mediaindexer.operation
  • Added: API level 12

Description

Gets the detailed meta data information for the specified uri of the video file.

Parameters

Name

Required

Type

Description

uriRequiredString

Indicates the uri of the video file.

Example: msc://D94A-BE4D/tmp/usb/sdg/sdg1/SampleVideo.mp4

Call Returns

Name

Required

Type

Description

metadataOptionalObject array: VideoMetadata

Indicates the meta data information of specified video file.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

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.

Example

Example: With uri

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getVideoMetadata '{"uri":"msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleVideofiles2.mp4"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "metadata": {
      "video_codec": "H.264 / AVC",
      "date_of_creation": "",
      "last_modified_date": "Wed Jul 22 09:07:44 2020 GMT",
      "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
      "height": 1080,
      "type": "video",
      "thumbnail": "/media/.thumbnail/D94A-BE4D/1740291740485930.jpg",
      "hash": "13604488937709551616",
      "title": "SampleVideofiles2.mp4",
      "width": 1920,
      "dirty": false,
      "frame_rate": "24000/1001",
      "mime": "video/mp4",
      "audio_codec": "MPEG-4 AAC audio",
      "file_size": 264881271,
      "file_path": "file:///tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
      "duration": 205
   },
   "errorText": "No Error"
}

putPlugin

ACG: mediaindexer.devutility
  • Added: API level 24

Description

Requests to add the plugin to the plugin factory.

Parameters

Name

Required

Type

Description

uriRequiredString

URI of the plugin to be added.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates adding plugin operation is successful.
  • false: Indicates adding plugin operation is failed.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Error Codes Reference

Error Code

Error Text

Error Description

-1Method "putPlugin" for category "/" was not handled

Method was not executed due to invalid input.

Example

Example scenario

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/putPlugin '{"uri": "mtp"}'

Response:

{
    "returnValue": true
}

requestDelete

ACG: mediaindexer.operation
  • Added: API level 24

Description

Requests deletion of media item from media DB connector.

Parameters

Name

Required

Type

Description

uriRequiredString

Playback URI for the given media item.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation is successful.
  • false: Indicates that the operation has failed.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

countOptionalNumber

Provides the list of medial files which are deleted from database.

Error Codes Reference

Error Code

Error Text

Error Description

-3970kind not registered: ''

If kind is not registered, this error will be returned.

-1Method "requestDelete" for category "/" was not handled

Method was not executed due to invalid input.

Example

Example scenario

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/requestDelete '{"uri": "/home/root/resolution_4.mp4"}'

Response:

{
    "returnValue": true,
    "count": 0
}

Example scenario

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/requestDelete '{"uri": "/home/root/"}'

Response:

{
    "errorCode": -3970,
    "errorText": "kind not registered: ''",
    "returnValue": false
}

requestMediaScan

ACG: mediaindexer.operation
  • Added: API level 24

Description

Scans device for media item.

Parameters

Name

Required

Type

Description

pathRequiredString

Playback URI for the given media item.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation is successful
  • false: Indicates that the operation has failed.
errorCodeRequiredNumber

The error code for the failed operation.

errorTextRequiredString

Indicates the reason for the failure of the operation.

Error Codes Reference

Error Code

Error Text

Error Description

-1Scan Failed

String in case of scan failure, this error will be returned.

-1Method "requestMediaScan" for category "/" was not handled

Method was not executed due to invalid input.

0No error

Operation is successful.

Example

Example scenario

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/requestMediaScan '{"path": "/media"}'

Response:

{
      "errorCode": 0,
      "returnValue": true,
      "errorText": "No Error"

}

runDetect

ACG: mediaindexer.devutility
  • Added: API level 24

Description

Requests to check plugins that are available in the known devices databases and then enables the device detection to notify the observer.

Parameters

Name

Required

Type

Description

uriOptionalString

URI of the plugin.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation is successful.
  • false: Indicates that the operation has failed
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Error Codes Reference

Error Code

Error Text

Error Description

-1Method "runDetect" for category "/" was not handled

Method was not executed due to invalid input.

Example

Example scenario

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/runDetect '{"uri": "msc"}'

Response:

{
    "returnValue": true
}

stopDetect

ACG: mediaindexer.devutility
  • Added: API level 24

Description

Requests not to detect the plugin in database for the known device and do not enable the device detection to notify the observer.

Parameters

Name

Required

Type

Description

uriOptionalString

URI of the plugin.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation is successful.
  • false: Indicates that the operation has failed.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Error Codes Reference

Error Code

Error Text

Error Description

-1Method "stopDetect" for category "/" was not handled

Method was not executed due to invalid input.

Example

Example scenario

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/stopDetect '{"uri": "mtp"}'

Response:

{
    "returnValue": true
}

Objects

AudioList

Contains the detailed information about the audio files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the audio file.

last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the accessible uri of the audio file (for playback usage).

titleOptionalString

Indicates the title information of the audio file.

durationOptionalNumber

Indicates the duration of the given video file (unit : second).

thumbnailOptionalString

Contains the thumbnail path information of the corresponding audio file.

genreOptionalString

Indicates the genre of the specified audio file.

albumOptionalString

Contains the album information of the specified audio file.

artistOptionalString

Indicates the artist information for the specified audio file.

AudioMetadata

Contains the information about the AudioList, and also provides detailed information that are not included in AudioList.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the audio file.

typeOptionalString

Indicates the type of the file.

Possible values are :

  • audio
  • video
  • image
last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the accessible uri of the audio file (for playback usage).

titleOptionalString

Indicates the title information of audio file.

durationOptionalNumber

Indicates the duration of the given video file (unit : second).

thumbnailOptionalString

Contains the thumbnail path information of the corresponding audio file.

mimeOptionalString

Indicates the mime type information of the audio file.

date_of_creationOptionalString

Contains the information of the recording date for the specified audio file.

genreOptionalString

Indicates the genre of the specified audio file.

albumOptionalString

Contains the album information for the specific audio file.

artistOptionalString

Contains the artist information for the specified audio file.

album_artistOptionalString

Contains the album artist information for the specified audio file.

Note: Distinct from artists for the tracks that constitute a release. Example: Various Artists

trackOptionalString

Contains the number information for the specified audio file.

total_trackOptionalString

Indicates the total tracks of a release that belong to the specified audio file.

sample_rateOptionalNumber

Contains the sampling rate information of the audio file.

bit_per_sampleOptionalString

Indicates the number of bits of information in each sample for the specified audio file.

channelOptionalNumber

Contains the information of the number of channels for a specified audio file.

lyricOptionalString

Contains the lyric information for the specified audio file.

bit_rateOptionalNumber

Contains the bitrate information for the specified audio file.

hashOptionalString

Indicates the value that specifies if an audio file has been modified or not.

Note: The property is intended for internal usage only.

dirtyOptionalBoolean

Indicates if the device includes audio files.

Possible values are:

  • true: detached
  • false: attached

Note: The property is intended for internal usage only.

ImageList

Detailed information about video files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the image file.

last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the absolute file path of the image file.

titleOptionalString

Indicates the title of the given image file.

widthOptionalNumber

Indicates the width of the given image.

heightOptionalNumber

Indicates the height of the given image.

ImageMetadata

Contains the information in the ImageList, and also provides detailed information that are not included in ImageList.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the image file.

typeOptionalString

Indicates the type of the file.

Possible values are :

  • audio
  • video
  • image
mimeOptionalString

Indicates the mime type of the image file.

last_modified_dateOptionalString

Contains the last file modification date information.

date_of_creationOptionalString

Indicates the date of creation for the given image file.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the absolute file path of the image file.

titleOptionalString

Indicates the title of the given image file.

widthOptionalNumber

Indicates the width of the given image.

heightOptionalString

Indicates the height of the given image.

geo_location_longtitudeOptionalString

Specifies the longitude information of the given image.

geo_location_latitudeOptionalString

Specifies the latitude information of the given image.

geo_location_countryOptionalString

Specifies the country information of the given image.

geo_location_cityOptionalString

Specifies the city information of the image.

hashOptionalString

Indicates the value that specifies if an audio file has been modified or not.

Note: The property is intended for internal usage only.

dirtyOptionalBoolean

Indicates if the device includes audio files.

Possible values are:

  • true: detached
  • false: attached

Note: The property is intended for internal usage only.

VideoList

Contains the detailed information about the video files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the given video file.

last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the accessible uri of the video file (for playback usage).

titleOptionalString

Indicates the title of the given video file.

durationOptionalNumber

Indicates the duration of the given video file (unit : second).

thumbnailOptionalString

Contains the thumbnail path information of the corresponding video file.

widthOptionalNumber

Indicates the width of the given video file.

heightOptionalNumber

Indicates the height of the given video file.

VideoMetadata

Contains the information about the VideoList, provides information about the video files that are not included in the VideoList.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the given video file.

titleOptionalString

Indicates the title of the given video file.

typeOptionalString

Indicates the type of the file.

Possible values are :

  • audio
  • video
  • image
last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the accessible uri of the video file (for playback usage).

durationOptionalNumber

Indicates the duration information of the video file (unit : second).

thumbnailOptionalString

Contains the thumbnail path information of the corresponding video file.

mimeOptionalString

Indicates the mime type information of the given video file.

date_of_creationOptionalString

Indicates the date of creation for the given image file.

widthOptionalNumber

Indicates the width of the given video file.

heightOptionalNumber

Indicates the height of the given video file.

frame_rateOptionalNumber

Indicates the frame rate information of the given video file.

video_codecOptionalString

Indicates the video codec information.

audio_codecOptionalString

Indicates the audio codec information.

hashOptionalString

Indicates the value that specifies if an audio file has been modified or not.

Note: The property is intended for internal usage only.

dirtyOptionalBoolean

Indicates if the device includes audio files.

Possible values are:

  • true: detached
  • false: attached

Note: The property is intended for internal usage only.

audioList

Includes information about the uri of the devices, total number of audio files inside and requested result of audio files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target.

countOptionalNumber

Indicates the number of audio files included in the specified device.

resultsOptionalObject array: AudioList

Contains the information of each audio file provided as an array format. 

deviceList

Provides the detailed information about the specific device connected to the media indexer service.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target.

nameOptionalString

Indicates the human-readable device name.

availableOptionalBoolean

Indicates if the device currently available.

Possible values are:

  • true: The device is currently available
  • false: The device is currently not available
iconOptionalString

Indicates the location of a device identification icon.

imageCountOptionalNumber

Indicates the number of image files stored in the connected devices.

videoCountOptionalNumber

Indicates the number of video files stored in the connected devices.

audioCountOptionalNumber

Indicates the number of audio files stored in the connected devices.

descriptionOptionalString

Contains a human-readable device description.

stateOptionalString

Indicates the state of the connected device

  • inactive: Device is not available.
  • scanning: Device is in initial scan mode.
  • idle: Scan has been completed, not monitoring.

imageList

Includes information about uri of the devices, total number of image files inside and requested result of the image files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target.

countOptionalNumber

Indicates the number of audio files included in the specified device.

resultsOptionalObject array: ImageList

Contains the information of each audio file provided in an array format.

pluginList

Defines the supported device types by the media indexer service.

Name

Required

Type

Description

uriOptionalString

Specifies the supported device type.

Possible values are:

  • msc: usb devices
  • storage: internal storage devices
activeOptionalBoolean

Indicates if the state of device can be changed.

Possible values are:

  • true: Subscribers can receive device status when it is changed
  • false: Subscribers cannot receive device status
deviceListOptionalObject: deviceList

Contains the detailed information about currently/previously attached devices.

videoList

Includes information about the uri of devices, total number of video files inside and requested result of the video files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target.

countOptionalNumber

Indicates the number of video files included in the specified device.

resultsOptionalString

Contains the information of each audio file provided in an array format.

Contents