Class MediaControlServer
Definition
- Namespace:
- Tizen.Multimedia.Remoting
- Assembly:
- Tizen.Multimedia.Remoting.dll
Provides a means to set playback information and metadata and receive commands from clients.
C#Copypublic static class MediaControlServer
- Inheritance
-
objectMediaControlServer
Properties
Declaration
C#Copypublic static bool IsRunning { get; }
Property Value
| Type | Description |
|---|---|
| bool | true if the server has started; otherwise, false. |
Methods
Declaration
C#Copypublic static IEnumerable<string> GetActivatedClients()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T><string> | the activated client ids. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | The server is not running . |
Declaration
C#Copypublic static void RemovePlaylist(MediaControlPlaylist playlist)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaControlPlaylist | playlist | The name of playlist. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.InvalidOperationException | The server is not running . |
Declaration
C#Copypublic static Task<Bundle> RequestAsync(Command command, string clientId)
Parameters
| Type | Name | Description |
|---|---|---|
| Command | command | A Command class. |
| string | clientId | The client Id to send command. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<TResult><Bundle> | Bundle represents the extra data from client and it can be null. |
Remarks
The client can request the command to execute Command,
and then, the server receive the result of each request(command).
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.InvalidOperationException | The server has already been stopped. |
Declaration
C#Copypublic static void Response(Command command, int result, Bundle bundle)
Parameters
| Type | Name | Description |
|---|---|---|
| Command | command | The command that return to client. |
| int | result | The result of |
| Bundle | bundle | The extra data. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.InvalidOperationException | The server is not running . |
Declaration
C#Copypublic static void Response(Command command, int result)
Parameters
| Type | Name | Description |
|---|---|---|
| Command | command | The command that return to client. |
| int | result | The result of |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.InvalidOperationException | The server is not running . |
Declaration
C#Copypublic static void SetAgeRating(int ageRating)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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 |
| System.InvalidOperationException | The server is not running . |
Declaration
C#Copypublic static void SetIconPath(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The path of icon. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | The server is not running . |
| System.ArgumentNullException |
|
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 |
|---|---|---|
| string | index | The index of current playing media. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.InvalidOperationException | The server is not running . |
SetInfoOfCurrentPlayingMedia(string, string)
Sets the playlist name and index of current playing media.
Declaration
C#Copypublic static void SetInfoOfCurrentPlayingMedia(string playlistName, string index)
Parameters
| Type | Name | Description |
|---|---|---|
| string | playlistName | The playlist name of current playing media. |
| string | index | The index of current playing media. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.InvalidOperationException | The server is not running . |
Declaration
C#Copypublic static void SetMetadata(MediaControlMetadata metadata)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaControlMetadata | metadata | The metadata to update. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.InvalidOperationException | The server is not running . |
SetPlaybackCapabilities(Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport>)
Sets the capabilities by MediaControlPlaybackCommand.
Declaration
C#Copypublic static void SetPlaybackCapabilities(Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport> capabilities)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.Dictionary<TKey, TValue><MediaControlPlaybackCommand, MediaControlCapabilitySupport> | capabilities | The set of MediaControlPlaybackCommand and MediaControlCapabilitySupport. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | The server is not running . |
| System.ArgumentException |
|
SetPlaybackCapability(MediaControlPlaybackCommand, MediaControlCapabilitySupport)
Sets the capabilities by MediaControlPlaybackCommand.
Declaration
C#Copypublic static void SetPlaybackCapability(MediaControlPlaybackCommand action, MediaControlCapabilitySupport support)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaControlPlaybackCommand | action | A playback command. |
| MediaControlCapabilitySupport | support | A value indicating whether the |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | The server is not running . |
| System.ArgumentException |
|
SetPlaybackContentType(MediaControlContentType)
Sets the content type of latest played media.
Declaration
C#Copypublic 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 . |
| System.ArgumentException |
|
SetPlaybackState(MediaControlPlaybackState, long)
Updates playback state and playback position.
Declaration
C#Copypublic static void SetPlaybackState(MediaControlPlaybackState state, long position)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaControlPlaybackState | state | The playback state. |
| long | position | The playback position in milliseconds. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
|
| System.ArgumentOutOfRangeException |
|
| System.InvalidOperationException | The server is not running . |
Declaration
C#Copypublic 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 . |
| System.ArgumentException |
|
SetRepeatModeCapability(MediaControlCapabilitySupport)
Sets the content type of latest played media.
Declaration
C#Copypublic 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 . |
| System.ArgumentException |
|
SetShuffleModeCapability(MediaControlCapabilitySupport)
Sets the MediaControlCapabilitySupport indicating shuffle mode is supported or not.
Declaration
C#Copypublic 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 . |
| System.ArgumentException |
|
Declaration
C#Copypublic static void SetShuffleModeEnabled(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | A value indicating whether the shuffle mode is enabled. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | The server is not running . |
Declaration
C#Copypublic static void Start()
Remarks
When the server starts, ServerStarted will be raised.
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | An internal error occurs. |
| System.UnauthorizedAccessException | Caller does not have required privilege. |
See Also
Declaration
C#Copypublic static void Stop()
Remarks
When the server stops, ServerStopped will be raised.
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | The server is not running . |
See Also
Events
Declaration
C#Copypublic static event EventHandler<CustomCommandReceivedEventArgs> CustomCommandReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><CustomCommandReceivedEventArgs> |
Declaration
C#Copypublic static event EventHandler<PlaybackActionCommandReceivedEventArgs> PlaybackActionCommandReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><PlaybackActionCommandReceivedEventArgs> |
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<TEventArgs><PlaybackCommandReceivedEventArgs> |
Declaration
C#Copypublic static event EventHandler<PlaybackPositionCommandReceivedEventArgs> PlaybackPositionCommandReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><PlaybackPositionCommandReceivedEventArgs> |
Declaration
C#Copypublic static event EventHandler<PlaylistCommandReceivedEventArgs> PlaylistCommandReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><PlaylistCommandReceivedEventArgs> |
Declaration
C#Copypublic static event EventHandler<RepeatModeCommandReceivedEventArgs> RepeatModeCommandReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><RepeatModeCommandReceivedEventArgs> |
Declaration
C#Copypublic static event EventHandler<SearchCommandReceivedEventArgs> SearchCommandReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><SearchCommandReceivedEventArgs> |
Declaration
C#Copypublic static event EventHandler<ShuffleModeCommandReceivedEventArgs> ShuffleModeCommandReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><ShuffleModeCommandReceivedEventArgs> |