Class MediaControlServer

Definition

Namespace:
Tizen.Multimedia.Remoting
Assembly:
Tizen.Multimedia.Remoting.dll
API Level:
4

Provides a means to set playback information and metadata and receive commands from clients.

C#
Copy
public static class MediaControlServer
Inheritance
System.Object
MediaControlServer

Properties

View Source

IsRunning

Gets a value indicating whether the server is running.

Declaration
C#
Copy
public static bool IsRunning { get; }
Property Value
Type Description
Boolean

true if the server has started; otherwise, false.

See Also
API Level: 4

Methods

View Source

GetActivatedClients()

Gets the active clients.

Declaration
C#
Copy
public static IEnumerable<string> GetActivatedClients()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

the activated client ids.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 5
View Source

RemovePlaylist(MediaControlPlaylist)

Delete playlist.

Declaration
C#
Copy
public static void RemovePlaylist(MediaControlPlaylist playlist)
Parameters
Type Name Description
MediaControlPlaylist playlist

The name of playlist.

Remarks

Currently, only server can remove the playlist.

Exceptions
Type Condition
System.ArgumentNullException

playlist is null.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 5
View Source

RequestAsync(Command, String)

Requests commands to the client.

Declaration
C#
Copy
[Obsolete("Deprecated since API8; Will be removed in API10. Please use RequestCommandAsync(Command command) instead.")] public static Task<Bundle> RequestAsync(Command command, string clientId)
Parameters
Type Name Description
Command command

A Command class.

System.String clientId

The client Id to send command.

Returns
Type Description
System.Threading.Tasks.Task<Bundle>

Bundle represents the extra data from client and it can be null.

Exceptions
Type Condition
System.ArgumentNullException

command or clientId is null.

System.InvalidOperationException

The server has already been stopped.
-or-
An internal error occurs.

See Also
API Level: 5
View Source

RequestCommandAsync(Command, String)

Requests a command to the client and server receives the result of each request(command).

Declaration
C#
Copy
public static Task<(Bundle bundle, int result)> RequestCommandAsync(Command command, string clientId)
Parameters
Type Name Description
Command command

A Command class.

System.String clientId

The client Id to send command.

Returns
Type Description
System.Threading.Tasks.Task<ValueTuple<Bundle, Int32>>

The type of return value is Tuple.
First item of Tuple represents the Bundle and it represents the extra data from client. It can be null.
Second item of Tuple represents the result of each request(command).

Exceptions
Type Condition
System.ArgumentNullException

command or clientId is null.

System.InvalidOperationException

The server has already been stopped.
-or-
An internal error occurs.

System.NotImplementedException

The command which is not supported is used.

See Also
API Level: 8
View Source

Response(Command, Int32)

Sends the result of each command.

Declaration
C#
Copy
public static void Response(Command command, int result)
Parameters
Type Name Description
Command command

The command that return to client.

Int32 result

The result of command.

Exceptions
Type Condition
System.ArgumentNullException

command is null.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 5
View Source

Response(Command, Int32, Bundle)

Sends the result of each command.

Declaration
C#
Copy
public static void Response(Command command, int result, Bundle bundle)
Parameters
Type Name Description
Command command

The command that return to client.

Int32 result

The result of command.

Bundle bundle

The extra data.

Exceptions
Type Condition
System.ArgumentNullException

command is null.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 5
View Source

Response(Command, MediaControlResult)

Sends the result of each command.

Declaration
C#
Copy
public static void Response(Command command, MediaControlResult result)
Parameters
Type Name Description
Command command

The command that return to client.

MediaControlResult result

The MediaControlResult of command.

Exceptions
Type Condition
System.ArgumentNullException

command is null.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 8
View Source

Response(Command, MediaControlResult, Bundle)

Sends the result of each command.

Declaration
C#
Copy
public static void Response(Command command, MediaControlResult result, Bundle bundle)
Parameters
Type Name Description
Command command

The command that return to client.

MediaControlResult result

The MediaControlResult of command.

Bundle bundle

The extra data.

Exceptions
Type Condition
System.ArgumentNullException

command is null.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 8
View Source

SetAgeRating(Int32)

Sets the age rating of latest played media.

Declaration
C#
Copy
public static void SetAgeRating(int ageRating)
Parameters
Type Name Description
Int32 ageRating

The Age rating of latest played media. The valid range is 0 to 19, inclusive. Especially, 0 means that media is suitable for all ages.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The specified ageRating is not valid.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 5
View Source

SetDisplayMode(MediaControlDisplayMode)

Sets the display mode.

Declaration
C#
Copy
public static void SetDisplayMode(MediaControlDisplayMode mode)
Parameters
Type Name Description
MediaControlDisplayMode mode

A value indicating the MediaControlDisplayMode.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 6
View Source

SetDisplayModeCapabilities(IDictionary<MediaControlDisplayMode, MediaControlCapabilitySupport>)

Sets the supported list of MediaControlDisplayMode.

Declaration
C#
Copy
public static void SetDisplayModeCapabilities(IDictionary<MediaControlDisplayMode, MediaControlCapabilitySupport> capabilities)
Parameters
Type Name Description
IDictionary<MediaControlDisplayMode, MediaControlCapabilitySupport> capabilities

The supported list of MediaControlDisplayMode.

Remarks

NotDecided is not allowed in display mode capability. The default value of each MediaControlDisplayMode is not supported.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

capabilities is invalid.

API Level: 6
View Source

SetDisplayModeCapability(MediaControlDisplayMode, MediaControlCapabilitySupport)

Sets the mode is supported or not.

Declaration
C#
Copy
public static void SetDisplayModeCapability(MediaControlDisplayMode mode, MediaControlCapabilitySupport support)
Parameters
Type Name Description
MediaControlDisplayMode mode

The MediaControlDisplayMode.

MediaControlCapabilitySupport support

A value indicating whether the mode is supported or not.

Remarks

NotDecided is not allowed in display mode capability.
The default value of each MediaControlDisplayMode is not supported.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

mode or support is invalid.

API Level: 6
View Source

SetDisplayRotation(Rotation)

Sets the display rotation.

Declaration
C#
Copy
public static void SetDisplayRotation(Rotation rotation)
Parameters
Type Name Description
Rotation rotation

A value indicating the Rotation.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 6
View Source

SetDisplayRotationCapabilities(IDictionary<Rotation, MediaControlCapabilitySupport>)

Sets the supported list of Rotation.

Declaration
C#
Copy
public static void SetDisplayRotationCapabilities(IDictionary<Rotation, MediaControlCapabilitySupport> capabilities)
Parameters
Type Name Description
IDictionary<Rotation, MediaControlCapabilitySupport> capabilities

The supported list of Rotation.

Remarks

NotDecided is not allowed in display rotation capability.
The default value of each Rotation is not supported.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

capabilities is invalid.

API Level: 6
View Source

SetDisplayRotationCapability(Rotation, MediaControlCapabilitySupport)

Sets the rotation is supported or not.

Declaration
C#
Copy
public static void SetDisplayRotationCapability(Rotation rotation, MediaControlCapabilitySupport support)
Parameters
Type Name Description
Rotation rotation

The Rotation.

MediaControlCapabilitySupport support

A value indicating whether the rotation is supported or not..

Remarks

NotDecided is not allowed in display rotation capability.
The default value of each Rotation is not supported.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

rotation or support is invalid.

API Level: 6
View Source

SetIconPath(String)

Sets the path of icon.

Declaration
C#
Copy
public static void SetIconPath(string path)
Parameters
Type Name Description
System.String path

The path of icon.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentNullException

path is invalid.

API Level: 5
View Source

SetIndexOfCurrentPlayingMedia(String)

Sets the index of current playing media.

Declaration
C#
Copy
[Obsolete("Please do not use! This will be deprecated. Please use SetInfoOfCurrentPlayingMedia instead.")] public static void SetIndexOfCurrentPlayingMedia(string index)
Parameters
Type Name Description
System.String index

The index of current playing media.

Exceptions
Type Condition
System.ArgumentNullException

index is null.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 5
View Source

SetInfoOfCurrentPlayingMedia(String, String)

Sets the playlist name and index of current playing media.

Declaration
C#
Copy
public static void SetInfoOfCurrentPlayingMedia(string playlistName, string index)
Parameters
Type Name Description
System.String playlistName

The playlist name of current playing media.

System.String index

The index of current playing media.

Exceptions
Type Condition
System.ArgumentNullException

playlistName or index is null.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 5
View Source

SetMetadata(MediaControlMetadata)

Updates metadata information.

Declaration
C#
Copy
public static void SetMetadata(MediaControlMetadata metadata)
Parameters
Type Name Description
MediaControlMetadata metadata

The metadata to update.

Exceptions
Type Condition
System.ArgumentNullException

metadata is null.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 4
View Source

SetMode360(Boolean)

Sets the 360 mode.

Declaration
C#
Copy
public static void SetMode360(bool isEnabled)
Parameters
Type Name Description
Boolean isEnabled

A value indicating whether the 360 mode is enabled.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 6
View Source

SetMode360Capability(MediaControlCapabilitySupport)

Sets the MediaControlCapabilitySupport indicating whether 360 mode is supported or not.

Declaration
C#
Copy
public static void SetMode360Capability(MediaControlCapabilitySupport support)
Parameters
Type Name Description
MediaControlCapabilitySupport support

A value indicating whether the 360 mode is supported or not.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

support is invalid.

API Level: 6
View Source

SetPlaybackCapabilities(Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport>)

Sets the capabilities by MediaControlPlaybackCommand.

Declaration
C#
Copy
public static void SetPlaybackCapabilities(Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport> capabilities)
Parameters
Type Name Description
System.Collections.Generic.Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport> capabilities

The set of MediaControlPlaybackCommand and MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

capabilities is invalid.

API Level: 5
View Source

SetPlaybackCapability(MediaControlPlaybackCommand, MediaControlCapabilitySupport)

Sets the capabilities by MediaControlPlaybackCommand.

Declaration
C#
Copy
public static void SetPlaybackCapability(MediaControlPlaybackCommand action, MediaControlCapabilitySupport support)
Parameters
Type Name Description
MediaControlPlaybackCommand action

A playback command.

MediaControlCapabilitySupport support

A value indicating whether the action is supported or not.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

action or support is invalid.

API Level: 5
View Source

SetPlaybackContentType(MediaControlContentType)

Sets the content type of latest played media.

Declaration
C#
Copy
public static void SetPlaybackContentType(MediaControlContentType type)
Parameters
Type Name Description
MediaControlContentType type

A value indicating the content type of the latest played media.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

type is invalid.

API Level: 5
View Source

SetPlaybackState(MediaControlPlaybackState, Int64)

Updates playback state and playback position.

Declaration
C#
Copy
public static void SetPlaybackState(MediaControlPlaybackState state, long position)
Parameters
Type Name Description
MediaControlPlaybackState state

The playback state.

System.Int64 position

The playback position in milliseconds.

Exceptions
Type Condition
System.ArgumentException

state is not valid.

System.ArgumentOutOfRangeException

position is less than zero.

System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 4
View Source

SetRepeatMode(MediaControlRepeatMode)

Updates the repeat mode.

Declaration
C#
Copy
public static void SetRepeatMode(MediaControlRepeatMode mode)
Parameters
Type Name Description
MediaControlRepeatMode mode

A value indicating the repeat mode.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

mode is invalid.

API Level: 4
View Source

SetRepeatModeCapability(MediaControlCapabilitySupport)

Sets the MediaControlCapabilitySupport indicating repeat mode is supported or not.

Declaration
C#
Copy
public static void SetRepeatModeCapability(MediaControlCapabilitySupport support)
Parameters
Type Name Description
MediaControlCapabilitySupport support

A value indicating whether the MediaControlRepeatMode is supported or not.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

support is invalid.

API Level: 5
View Source

SetShuffleModeCapability(MediaControlCapabilitySupport)

Sets the MediaControlCapabilitySupport indicating shuffle mode is supported or not.

Declaration
C#
Copy
public static void SetShuffleModeCapability(MediaControlCapabilitySupport support)
Parameters
Type Name Description
MediaControlCapabilitySupport support

A value indicating whether the shuffle mode is supported or not.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

support is invalid.

API Level: 5
View Source

SetShuffleModeEnabled(Boolean)

Updates the shuffle mode.

Declaration
C#
Copy
public static void SetShuffleModeEnabled(bool enabled)
Parameters
Type Name Description
Boolean enabled

A value indicating whether the shuffle mode is enabled.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 4
View Source

SetSubtitleMode(Boolean)

Sets the subtitle mode.

Declaration
C#
Copy
public static void SetSubtitleMode(bool isEnabled)
Parameters
Type Name Description
Boolean isEnabled

A value indicating whether the subtitle mode is enabled.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

API Level: 6
View Source

SetSubtitleModeCapability(MediaControlCapabilitySupport)

Sets the MediaControlCapabilitySupport indicating whether subtitle mode is supported or not.

Declaration
C#
Copy
public static void SetSubtitleModeCapability(MediaControlCapabilitySupport support)
Parameters
Type Name Description
MediaControlCapabilitySupport support

A value indicating whether the subtitle mode is supported or not.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

System.ArgumentException

support is invalid.

API Level: 6
View Source

Start()

Starts the media control server.

Declaration
C#
Copy
public static void Start()
Remarks

When the server starts, ServerStarted will be raised.

Exceptions
Type Condition
System.InvalidOperationException

An internal error occurs.

UnauthorizedAccessException

Caller does not have required privilege.

See Also
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/mediacontroller.server
View Source

Stop()

Stops the media control server.

Declaration
C#
Copy
public static void Stop()
Remarks

When the server stops, ServerStopped will be raised.

Exceptions
Type Condition
System.InvalidOperationException

The server is not running .
-or-
An internal error occurs.

See Also
API Level: 4

Events

View Source

CustomCommandReceived

Occurs when a client sends custom command.

Declaration
C#
Copy
public static event EventHandler<CustomCommandReceivedEventArgs> CustomCommandReceived
Event Type
Type Description
System.EventHandler<CustomCommandReceivedEventArgs>
API Level: 5
View Source

DisplayModeCommandReceived

Occurs when a client sends display mode command.

Declaration
C#
Copy
public static event EventHandler<DisplayModeCommandReceivedEventArgs> DisplayModeCommandReceived
Event Type
Type Description
System.EventHandler<DisplayModeCommandReceivedEventArgs>
API Level: 6
View Source

DisplayRotationCommandReceived

Occurs when a client sends display rotation command.

Declaration
C#
Copy
public static event EventHandler<DisplayRotationCommandReceivedEventArgs> DisplayRotationCommandReceived
Event Type
Type Description
System.EventHandler<DisplayRotationCommandReceivedEventArgs>
API Level: 6
View Source

Mode360CommandReceived

Occurs when a client sends mode 360 command.

Declaration
C#
Copy
public static event EventHandler<Mode360CommandReceivedEventArgs> Mode360CommandReceived
Event Type
Type Description
System.EventHandler<Mode360CommandReceivedEventArgs>
API Level: 6
View Source

PlaybackActionCommandReceived

Occurs when a client sends playback command.

Declaration
C#
Copy
public static event EventHandler<PlaybackActionCommandReceivedEventArgs> PlaybackActionCommandReceived
Event Type
Type Description
System.EventHandler<PlaybackActionCommandReceivedEventArgs>
API Level: 5
View Source

PlaybackCommandReceived

Occurs when a client sends playback command.

Declaration
C#
Copy
[Obsolete("Please do not use! This will be deprecated. Please use PlaybackActionCommandReceived instead.")] public static event EventHandler<PlaybackCommandReceivedEventArgs> PlaybackCommandReceived
Event Type
Type Description
System.EventHandler<PlaybackCommandReceivedEventArgs>
API Level: 4
View Source

PlaybackPositionCommandReceived

Occurs when a client sends playback position command.

Declaration
C#
Copy
public static event EventHandler<PlaybackPositionCommandReceivedEventArgs> PlaybackPositionCommandReceived
Event Type
Type Description
System.EventHandler<PlaybackPositionCommandReceivedEventArgs>
API Level: 5
View Source

PlaylistCommandReceived

Occurs when a client sends playlist command.

Declaration
C#
Copy
public static event EventHandler<PlaylistCommandReceivedEventArgs> PlaylistCommandReceived
Event Type
Type Description
System.EventHandler<PlaylistCommandReceivedEventArgs>
API Level: 5
View Source

RepeatModeCommandReceived

Occurs when a client sends repeat mode command.

Declaration
C#
Copy
public static event EventHandler<RepeatModeCommandReceivedEventArgs> RepeatModeCommandReceived
Event Type
Type Description
System.EventHandler<RepeatModeCommandReceivedEventArgs>
API Level: 5
View Source

SearchCommandReceived

Occurs when a client sends search command.

Declaration
C#
Copy
public static event EventHandler<SearchCommandReceivedEventArgs> SearchCommandReceived
Event Type
Type Description
System.EventHandler<SearchCommandReceivedEventArgs>
API Level: 5
View Source

ShuffleModeCommandReceived

Occurs when a client sends shuffle mode command.

Declaration
C#
Copy
public static event EventHandler<ShuffleModeCommandReceivedEventArgs> ShuffleModeCommandReceived
Event Type
Type Description
System.EventHandler<ShuffleModeCommandReceivedEventArgs>
API Level: 5
View Source

SubtitleModeCommandReceived

Occurs when a client sends subtitle mode command.

Declaration
C#
Copy
public static event EventHandler<SubtitleModeCommandReceivedEventArgs> SubtitleModeCommandReceived
Event Type
Type Description
System.EventHandler<SubtitleModeCommandReceivedEventArgs>
API Level: 6

See Also