module dlna { interface DlnaError : GenericError { const unsigned short NO_SELECTION_ERROR = 1; }; interface DlnaDevice { const unsigned short DLNA_DEVICE_TYPE_RENDERER = 0; const unsigned short DLNA_DEVICE_TYPE_SERVER = 1; readonly attribute unsigned short deviceType; readonly attribute DOMString name; }; [Callback=FunctionOnly, NoInterfaceObject] interface DlnaGetVolumeSuccessCallback { void onSuccess(in unsigned short volume); }; interface DlnaRenderer : DlnaDevice { readonly attribute DOMString playCapabilities; PendingOperation getVolume(in DlnaGetVolumeSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation setVolume(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned short volume) raises (SecurityError, DeviceAPIError, DlnaError); }; typedef sequence<DlnaObject> DlnaObjectArray; typedef sequence<DlnaRenderer> DlnaRendererArray; typedef sequence<DlnaServer> DlnaServerArray; interface DlnaObject { readonly attribute unsigned short objectType; }; [Callback=FunctionOnly, NoInterfaceObject] interface DlnaObjectSelectSuccessCallback { void onSuccess(in DlnaPlaybackObject playbackObject); }; [Callback=FunctionOnly, NoInterfaceObject] interface DlnaSuccessCallback { void onSuccess(); }; [Callback=FunctionOnly, NoInterfaceObject] interface DlnaErrorCallback { void onError(in DlnaError error); }; [Callback=FunctionOnly, NoInterfaceObject] interface DlnaGetPositionSuccessCallback { void onSuccess(in DOMString position); }; interface DlnaServer : DlnaDevice { readonly attribute DlnaMediaContainer root; readonly attribute DOMString sortCapabilities; readonly attribute DOMString searchCapabilities; boolean registerServerListener(in DlnaServerListener listener) raises(SecurityError, DeviceAPIError); void unregisterServerListener(in DlnaServerListener listener) raises(SecurityError, DeviceAPIError); }; interface DlnaController { boolean registerDeviceListener(in DlnaDeviceListener listener) raises(SecurityError, DeviceAPIError); void unregisterDeviceListener(in DlnaDeviceEventListener listener) raises(SecurityError, DeviceAPIError); PendingOperation select(in DlnaObjectSelectSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in DlnaMediaObject media, in DlnaRenderer renderer) raises (DlnaError); boolean isPlayable(in DlnaMediaObject media, in DlnaRenderer renderer) raises (DlnaError); readonly attribute DlnaRendererArray currentRenderers; readonly attribute DlnaServerArray currentServers; }; interface DlnaPlaybackObject { PendingOperation play(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, [Optional] in DOMString position) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation stop(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation pause(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation getPosition(in DlnaGetPositionSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation fastForward(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned long speed) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation rewind(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned long speed) raises (SecurityError, DeviceAPIError, DlnaError); }; [Callback] interface DlnaDeviceListener { void deviceAdded(in DlnaDevice device); void deviceRemoved(in DlnaDevice device); }; [Callback] interface DlnaServerListener { void mediaObjectsAdded(); void mediaObjectsRemoved(); void mediaObjectsUpdated(); void sortCapabilitiesReady(); void searchCapabilitiesReady(); }; interface DlnaMediaObject : DlnaObject { const unsigned short DLNA_OBJECT_TYPE_CONTAINER = 0; const unsigned short DLNA_OBJECT_TYPE_MEDIA = 1; readonly attribute DOMString type; readonly attribute DOMString id; readonly attribute DOMString title; readonly attribute Date datetime; readonly attribute DOMString url; readonly attribute DOMString genre; readonly attribute DOMString artist; }; [Callback=FunctionOnly, NoInterfaceObject] interface DlnaBrowseSuccessCallback { void onSuccess(in unsigned long startOffset, in unsigned long totalCount, in DlnaObjectArray mediaObjects); }; interface DlnaMediaContainer : DlnaObject { PendingOperation browse(in DlnaBrowseSuccessCallback successCallback, in DlnaErrorCallback errorCallback, [Optional] in unsigned long startOffset, in unsigned long maxCount); PendingOperation search(in DlnaBrowseSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in DOMString search, in DOMString filter, in DOMString sorting, [Optional] in unsigned long startOffset, in unsigned long maxCount); readonly attribute DlnaObjectArray currentObjects; readonly attribute DlnaServer server; }; }; Provides access to DLNA services

This API enables discovery of the DLNA devices in the local network, control of the devices. It shall/could be coupled with the Media Player API for local playback.

Enables discovery of the devices and medias in the local network

Discovery of the DLNA devices and medias

Enables rendering of the medias in the local network on DLNA renderer (DMR)

Rendering of the DLNA media on DMR
Marcin Hanclik <marcin.hanclik@access-company.com> 1.5
interface DlnaError : GenericError { const unsigned short NO_SELECTION_ERROR = 1; }; DLNA Errors const unsigned short NO_SELECTION_ERROR = 1; No media was selected for playback interface DlnaDevice { const unsigned short DLNA_DEVICE_TYPE_RENDERER = 0; const unsigned short DLNA_DEVICE_TYPE_SERVER = 1; readonly attribute unsigned short deviceType; readonly attribute DOMString name; }; Base interface for DLNA devices (renderer and server). const unsigned short DLNA_DEVICE_TYPE_RENDERER = 0; Constant used to identify the type of DLNA device as a renderer. const unsigned short DLNA_DEVICE_TYPE_SERVER = 1; Constant used to identify the type of DLNA device as a server. readonly attribute unsigned short deviceType; Indicates the type of device (renderer or server) if(deviceType == DLNA_DEVICE_TYPE_SERVER) { // this is a DLNA server } readonly attribute DOMString name; Advertised name of the device document.getElementById("servername").innerHTML = name; [Callback=FunctionOnly, NoInterfaceObject] interface DlnaGetVolumeSuccessCallback { void onSuccess(in unsigned short volume); }; DLNA DlnaRender.getVolume specific success callback.

This callback interface specifies a success callback with a function taking the volume value as input argument. It is used only with getVolume method of DlnaRender interface.

void onSuccess(in unsigned short volume); Method invoked when the asynchronous call completes succesfully

The volume value that was requested with DlnaRenderer.getVolumen method (0-100%).

interface DlnaRenderer : DlnaDevice { readonly attribute DOMString playCapabilities; PendingOperation getVolume(in DlnaGetVolumeSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation setVolume(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned short volume) raises (SecurityError, DeviceAPIError, DlnaError); }; readonly attribute DOMString playCapabilities; Media types (MIME types) supported by the renderer. PendingOperation getVolume(in DlnaGetVolumeSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); This method gets the volume on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the volume getting was accomplished successfully

called if an error occured.

PendingOperation setVolume(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned short volume) raises (SecurityError, DeviceAPIError, DlnaError); This method sets the volume on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the volume setting was accomplished successfully

called if an error occured.

Volumen value (in %, from 0 to 100)

typedef sequence<DlnaObject> DlnaObjectArray; Array of DLNA objects: media containers and media files. typedef sequence<DlnaRenderer> DlnaRendererArray; Array of DLNA renderers (DMR). typedef sequence<DlnaServer> DlnaServerArray; Array of DLNA servers (DMS). interface DlnaObject { readonly attribute unsigned short objectType; }; Base interface for media container and media file. readonly attribute unsigned short objectType; Indicates the type of object (container or media file) if(objectType == DLNA_OBJECT_TYPE_CONTAINER) { // this is a container } [Callback=FunctionOnly, NoInterfaceObject] interface DlnaObjectSelectSuccessCallback { void onSuccess(in DlnaPlaybackObject playbackObject); }; DLNA DlnaController.select specific success callback.

This callback interface specifies a success callback with a function taking a PlaybackObject object as input argument. It is used only with select method of DlnaController interface.

void onSuccess(in DlnaPlaybackObject playbackObject); Method invoked when the asynchronous call to DlnaController.select completes successfully.

The PlaybackObject that was requested with DlnaController.select() method.

[Callback=FunctionOnly, NoInterfaceObject] interface DlnaSuccessCallback { void onSuccess(); }; DLNA specific success callback.

This callback interface specifies a generic success callback for DLNA APIs.

void onSuccess(); Method invoked when the asynchronous call completes successfully.
[Callback=FunctionOnly, NoInterfaceObject] interface DlnaErrorCallback { void onError(in DlnaError error); }; DLNA specific error callback.

This callback interface specifies a generic error callback for DLNA APIs.

void onError(in DlnaError error); Method invoked when the asynchronous call fails.

Error code providing more information about the reason of the failure.

[Callback=FunctionOnly, NoInterfaceObject] interface DlnaGetPositionSuccessCallback { void onSuccess(in DOMString position); }; DLNA DlnaPlaybackObject.getPosition specific success callback.

This callback interface specifies a success callback with a function taking a PlaybackObject object as input argument. It is used only with select method of DlnaController interface.

void onSuccess(in DOMString position); Method invoked when the asynchronous call to DlnaPlaybackObject.getPosition succeeds.

Playback position in HH:MM:SS.msec format relative to the beginning of the media.

interface DlnaServer : DlnaDevice { readonly attribute DlnaMediaContainer root; readonly attribute DOMString sortCapabilities; readonly attribute DOMString searchCapabilities; boolean registerServerListener(in DlnaServerListener listener) raises(SecurityError, DeviceAPIError); void unregisterServerListener(in DlnaServerListener listener) raises(SecurityError, DeviceAPIError); }; DLNA Server (DMS) interface.

This interface enable registratior of the listener for server specific events. It provides access to the root of the file hierarchy within the server and information about DMS' sort and search capabilities.

readonly attribute DlnaMediaContainer root; Root media container (folder) of the server. Browsing of the data on the DMS starts here. readonly attribute DOMString sortCapabilities; Sort capabilities of the DLNA server (DMS) alert(server.sortCapabilities);//should display something like "upnp:foreignMetadata::fmBody::fmURI" readonly attribute DOMString searchCapabilities; Search capabilities of the DLNA server (DMS) alert(server.searchCapabilities);//should display something like "upnp:foreignMetadata::fmBody::fmURI" boolean registerServerListener(in DlnaServerListener listener) raises(SecurityError, DeviceAPIError); This method registers the listener for server events

true if successful

Listener

void unregisterServerListener(in DlnaServerListener listener) raises(SecurityError, DeviceAPIError); This method unregisters the listener for server events

Listener

interface DlnaController { boolean registerDeviceListener(in DlnaDeviceListener listener) raises(SecurityError, DeviceAPIError); void unregisterDeviceListener(in DlnaDeviceEventListener listener) raises(SecurityError, DeviceAPIError); PendingOperation select(in DlnaObjectSelectSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in DlnaMediaObject media, in DlnaRenderer renderer) raises (DlnaError); boolean isPlayable(in DlnaMediaObject media, in DlnaRenderer renderer) raises (DlnaError); readonly attribute DlnaRendererArray currentRenderers; readonly attribute DlnaServerArray currentServers; }; boolean registerDeviceListener(in DlnaDeviceListener listener) raises(SecurityError, DeviceAPIError); This method registers the listener for device events

true if successful

Listener

void unregisterDeviceListener(in DlnaDeviceEventListener listener) raises(SecurityError, DeviceAPIError); This method unregisters the listener for device events

Listener

PendingOperation select(in DlnaObjectSelectSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in DlnaMediaObject media, in DlnaRenderer renderer) raises (DlnaError); This method starts the playback of a media object on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the selection was accomplished successfully

called if an error occured.

Media object to be selected for rendering

Renderer that is to play the media object

boolean isPlayable(in DlnaMediaObject media, in DlnaRenderer renderer) raises (DlnaError); This method determins whether the given renderer is able to playback the given media object

true if playback is possible

Media object to be selected for rendering

Renderer that is to play the media object

readonly attribute DlnaRendererArray currentRenderers; Renderers that are currently available readonly attribute DlnaServerArray currentServers; Servers that are currently available
interface DlnaPlaybackObject { PendingOperation play(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, [Optional] in DOMString position) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation stop(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation pause(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation getPosition(in DlnaGetPositionSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation fastForward(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned long speed) raises (SecurityError, DeviceAPIError, DlnaError); PendingOperation rewind(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned long speed) raises (SecurityError, DeviceAPIError, DlnaError); }; PendingOperation play(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, [Optional] in DOMString position) raises (SecurityError, DeviceAPIError, DlnaError); This method starts the playback of a media object on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the playback of the media object was started successfully

called if an error occured.

The position at which the playback should start.

PendingOperation stop(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); This method starts the playback of a media object on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the playback of the media object was started successfully

called if an error occured.

PendingOperation pause(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); This method starts the playback of a media object on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the playback of the media object was started successfully

called if an error occured.

PendingOperation getPosition(in DlnaGetPositionSuccessCallback successCallback, in DlnaErrorCallback errorCallback) raises (SecurityError, DeviceAPIError, DlnaError); This method starts the playback of a media object on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the playback of the media object was started successfully

called if an error occured.

PendingOperation fastForward(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned long speed) raises (SecurityError, DeviceAPIError, DlnaError); This method starts the playback of a media object on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the playback of the media object was started successfully

called if an error occured.

The speed of fastforwarding

PendingOperation rewind(in DlnaSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in unsigned long speed) raises (SecurityError, DeviceAPIError, DlnaError); This method starts the playback of a media object on renderer (DMR)

PendingOperation enabling the requester to cancel this request.

called when the playback of the media object was started successfully

called if an error occured.

The speed of rewinding

[Callback] interface DlnaDeviceListener { void deviceAdded(in DlnaDevice device); void deviceRemoved(in DlnaDevice device); }; Listener for the generic DLNA device events void deviceAdded(in DlnaDevice device); Called when a new device advertised itself

DLNA device that was added.

void deviceRemoved(in DlnaDevice device); Called when a device was removed from the network

DLNA device that was removed.

[Callback] interface DlnaServerListener { void mediaObjectsAdded(); void mediaObjectsRemoved(); void mediaObjectsUpdated(); void sortCapabilitiesReady(); void searchCapabilitiesReady(); }; Listener for the server events void mediaObjectsAdded(); Called when a new media object was added to the server void mediaObjectsRemoved(); Called when a media object was removed from the server void mediaObjectsUpdated(); Called when a media object was updated on the server void sortCapabilitiesReady(); Called when the server's sorting capabilities are ready (sortCapabilities is filled with data) void searchCapabilitiesReady(); Called when the server's searching capabilities are ready (searchCapabilities is filled with data) interface DlnaMediaObject : DlnaObject { const unsigned short DLNA_OBJECT_TYPE_CONTAINER = 0; const unsigned short DLNA_OBJECT_TYPE_MEDIA = 1; readonly attribute DOMString type; readonly attribute DOMString id; readonly attribute DOMString title; readonly attribute Date datetime; readonly attribute DOMString url; readonly attribute DOMString genre; readonly attribute DOMString artist; }; Type of this media file. alert(media.type); // displays the type of the media file const unsigned short DLNA_OBJECT_TYPE_CONTAINER = 0; Container object. const unsigned short DLNA_OBJECT_TYPE_MEDIA = 1; Media object. readonly attribute DOMString type; Type of this media file. alert(media.type); // displays the type of the media file readonly attribute DOMString id; Identifier of this media file. The identifier is local to the DMS. alert(media.id); // displays the identifier of the media file readonly attribute DOMString title; Title of this media file. alert(media.title); // displays the title of the media file readonly attribute Date datetime; Date and time associated with this media file. alert(media.datetime); // displays the date and time of the media file readonly attribute DOMString url; URL that points to this media file. alert(media.url); // displays the URL of the media file readonly attribute DOMString genre; Genre of this media file. alert(media.genre); // displays the genre of the media file readonly attribute DOMString artist; Type of this media file. alert(media.type); // displays the type of the media file [Callback=FunctionOnly, NoInterfaceObject] interface DlnaBrowseSuccessCallback { void onSuccess(in unsigned long startOffset, in unsigned long totalCount, in DlnaObjectArray mediaObjects); }; DLNA DlnaMediaContainer.browser and .search specific success callback.

This callback interface specifies a success callback with a function taking the start offset, total count (on server) and the array of the media objects as input arguments. It is used only with browse and search methods of DlnaMediaContainer interface.

void onSuccess(in unsigned long startOffset, in unsigned long totalCount, in DlnaObjectArray mediaObjects); Method invoked when the asynchronous call completes successfully

The position of the media object in the list of media objects on the server.

Total number of media objects in the container.

Media objects' metadata retrieved from the server during this execution of the browser or search.

interface DlnaMediaContainer : DlnaObject { PendingOperation browse(in DlnaBrowseSuccessCallback successCallback, in DlnaErrorCallback errorCallback, [Optional] in unsigned long startOffset, in unsigned long maxCount); PendingOperation search(in DlnaBrowseSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in DOMString search, in DOMString filter, in DOMString sorting, [Optional] in unsigned long startOffset, in unsigned long maxCount); readonly attribute DlnaObjectArray currentObjects; readonly attribute DlnaServer server; }; PendingOperation browse(in DlnaBrowseSuccessCallback successCallback, in DlnaErrorCallback errorCallback, [Optional] in unsigned long startOffset, in unsigned long maxCount); Type of this media file. pending = container.browse(successcb, errorcb, 0, 10);

PendingOperation enabling the requester to cancel this request.

called when the media objects' metadata has been copied.

called if an error occured.

The position of the media object in the list of media objects on the server.

Maximum number of media objects that can be handled by the client in this request.

PendingOperation search(in DlnaBrowseSuccessCallback successCallback, in DlnaErrorCallback errorCallback, in DOMString search, in DOMString filter, in DOMString sorting, [Optional] in unsigned long startOffset, in unsigned long maxCount); Type of this media file. pending = container.search(successcb, errorcb, "dc:title contains 'tenderness'", "upnp:longDescription,dc:creator", "+upnp:artist,-dc:date,+dc:title", 0, 10);

PendingOperation enabling the requester to cancel this request.

called when the media objects' metadata has been copied.

called if an error occured.

Search options

Output filtering options

Sorting options

The position of the media object in the list of media objects on the server.

Maximum number of media objects that can be handled by the client in this request.

readonly attribute DlnaObjectArray currentObjects; Media objects that are currently available (i.e. were retrieved) readonly attribute DlnaServer server; Server on which the media container resides.