Class MediaController
Definition
- Namespace:
- Tizen.Multimedia.Remoting
- Assembly:
- Tizen.Multimedia.Remoting.dll
Provides a means to send commands to and handle events from media control server.
public class MediaController
- Inheritance
-
objectMediaController
Properties
View SourceIsStopped
Gets a value indicating whether the sever has been stopped.
Declaration
public bool IsStopped { get; }
Property Value
Type | Description |
---|---|
bool | true if the server has been stopped; otherwise, false. |
ServerAppId
Gets the application id of the server.
Declaration
public string ServerAppId { get; }
Property Value
Type | Description |
---|---|
string | The server application id. |
Methods
View SourceGetAgeRatingOfCurrentPlayingMedia()
Gets the age rating of current playing media.
Declaration
public int GetAgeRatingOfCurrentPlayingMedia()
Returns
Type | Description |
---|---|
int | The Age rating of current playing media. The range is 0 to 19, inclusive. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetContentTypeOfCurrentPlayingMedia()
Gets the content type of current playing media.
Declaration
public MediaControlContentType GetContentTypeOfCurrentPlayingMedia()
Returns
Type | Description |
---|---|
MediaControlContentType |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetCustomCommandCapability()
Gets the value whether the custom command is supported or not.
Declaration
public MediaControlCapabilitySupport GetCustomCommandCapability()
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetDisplayMode()
Gets the current display mode.
Declaration
public MediaControlDisplayMode GetDisplayMode()
Returns
Type | Description |
---|---|
MediaControlDisplayMode |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetDisplayModeCapability()
Gets the value whether the repeat mode is supported or not.
Declaration
public IEnumerable<MediaControlDisplayMode> GetDisplayModeCapability()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><MediaControlDisplayMode> | If there's no supported display mode by server, it will return null. otherwise, it will return the supported list of MediaControlDisplayMode. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetDisplayRotation()
Gets the current display rotation.
Declaration
public Rotation GetDisplayRotation()
Returns
Type | Description |
---|---|
Rotation | The Rotation. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetDisplayRotationCapability()
Gets the value whether the display mode is supported or not.
Declaration
public IEnumerable<Rotation> GetDisplayRotationCapability()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Rotation> | If there's no supported display rotation by server, it will return null. otherwise, it will return the supported list of Rotation. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetIconPath()
Gets the icon path.
Declaration
public string GetIconPath()
Returns
Type | Description |
---|---|
string | The icon path. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetIndexOfCurrentPlayingMedia()
Returns the index of current playing media.
Declaration
public string GetIndexOfCurrentPlayingMedia()
Returns
Type | Description |
---|---|
string | The index of current playing media. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetMetadata()
Returns the metadata set by the server.
Declaration
public MediaControlMetadata GetMetadata()
Returns
Type | Description |
---|---|
MediaControlMetadata | The metadata. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
See Also
View SourceGetMode360Capability()
Gets the value whether the 360 mode is supported or not.
Declaration
public MediaControlCapabilitySupport GetMode360Capability()
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetPlaybackCapabilities()
Gets the value whether MediaControlPlaybackCommand is supported or not.
Declaration
public Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport> GetPlaybackCapabilities()
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<TKey, TValue><MediaControlPlaybackCommand, MediaControlCapabilitySupport> | the set of MediaControlPlaybackCommand and MediaControlCapabilitySupport. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetPlaybackCapability(MediaControlPlaybackCommand)
Gets the value whether action
is supported or not.
Declaration
public MediaControlCapabilitySupport GetPlaybackCapability(MediaControlPlaybackCommand action)
Parameters
Type | Name | Description |
---|---|---|
MediaControlPlaybackCommand | action | A playback command. |
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetPlaybackPosition()
Returns the playback position set by the server.
Declaration
public long GetPlaybackPosition()
Returns
Type | Description |
---|---|
long | The playback position in milliseconds. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
See Also
View SourceGetPlaybackPositionCapability()
Gets the value whether the playback position is supported or not.
Declaration
public MediaControlCapabilitySupport GetPlaybackPositionCapability()
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetPlaybackState()
Returns the playback state set by the server.
Declaration
public MediaControlPlaybackState GetPlaybackState()
Returns
Type | Description |
---|---|
MediaControlPlaybackState | The playback state. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
See Also
View SourceGetPlaylistCapability()
Gets the value whether the playlist is supported or not.
Declaration
public MediaControlCapabilitySupport GetPlaylistCapability()
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetPlaylistOfCurrentPlayingMedia()
Returns the playlist name of current playing media.
Declaration
public MediaControlPlaylist GetPlaylistOfCurrentPlayingMedia()
Returns
Type | Description |
---|---|
MediaControlPlaylist | The playlist name. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetPlaylists()
Returns the all playlists.
Declaration
public IEnumerable<MediaControlPlaylist> GetPlaylists()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><MediaControlPlaylist> | The set of MediaControlPlaylist. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetRepeatMode()
Returns the repeat mode.
Declaration
public MediaControlRepeatMode GetRepeatMode()
Returns
Type | Description |
---|---|
MediaControlRepeatMode | A MediaControlRepeatMode set by the server. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
See Also
View SourceGetRepeatModeCapability()
Gets the value whether the repeat mode is supported or not.
Declaration
public MediaControlCapabilitySupport GetRepeatModeCapability()
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetSearchCapability()
Gets the value whether the search is supported or not.
Declaration
public MediaControlCapabilitySupport GetSearchCapability()
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetShuffleModeCapability()
Gets the value whether the shuffle mode is supported or not.
Declaration
public MediaControlCapabilitySupport GetShuffleModeCapability()
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
GetSubtitleModeCapability()
Gets the value whether the subtitle mode is supported or not.
Declaration
public MediaControlCapabilitySupport GetSubtitleModeCapability()
Returns
Type | Description |
---|---|
MediaControlCapabilitySupport |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
IsMode360Enabled()
Gets whether the 360 mode is enabled or not.
Declaration
public bool IsMode360Enabled()
Returns
Type | Description |
---|---|
bool | A value indicating whether the 360 mode is enabled or not. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
IsShuffleModeEnabled()
Returns whether the shuffle mode is enabled.
Declaration
public bool IsShuffleModeEnabled()
Returns
Type | Description |
---|---|
bool | A value indicating whether the shuffle mode is enabled. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
See Also
View SourceIsSubtitleModeEnabled()
Gets whether the subtitle mode is enabled or not.
Declaration
public bool IsSubtitleModeEnabled()
Returns
Type | Description |
---|---|
bool | A value indicating whether the subtitle mode is enabled or not. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
RequestAsync(Command)
Requests command to the server.
Declaration
[Obsolete("Deprecated since API8; Will be removed in API10. Please use RequestCommandAsync(Command command) instead.")]
public Task<Bundle> RequestAsync(Command command)
Parameters
Type | Name | Description |
---|---|---|
Command | command | A Command class. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><Bundle> | Bundle represents the extra data from server and it can be null. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
See Also
RequestCommandAsync(Command)
Requests a command to the server and client receives the result of each request(command).
Declaration
public Task<(Bundle bundle, int result)> RequestCommandAsync(Command command)
Parameters
Type | Name | Description |
---|---|---|
Command | command | A Command class. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><(Bundle bundle, int result)> | The type of return value is Tuple. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.InvalidOperationException | The server has already been stopped. |
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
See Also
Response(Command, int, Bundle)
Sends the result of each command.
Declaration
public 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 . |
Response(Command, int)
Sends the result of each command.
Declaration
public 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 . |
Response(Command, MediaControlResult, Bundle)
Sends the result of each command.
Declaration
public 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 |
Bundle | bundle | The extra data. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.InvalidOperationException | The server is not running . |
Response(Command, MediaControlResult)
Sends the result of each command.
Declaration
public void Response(Command command, MediaControlResult result)
Parameters
Type | Name | Description |
---|---|---|
Command | command | The command that return to client. |
MediaControlResult | result | The MediaControlResult of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.InvalidOperationException | The server is not running . |
SendPlaybackCommand(MediaControlPlaybackCommand)
Sends playback command to the server.
Declaration
[Obsolete("Please do not use! This will be deprecated. Please use Request instead.")]
public void SendPlaybackCommand(MediaControlPlaybackCommand command)
Parameters
Type | Name | Description |
---|---|---|
MediaControlPlaybackCommand | command | A playback command. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The server has already been stopped. |
System.ArgumentException |
|
System.ObjectDisposedException | The MediaControllerManager has already been disposed. |
See Also
Events
View SourceCustomCommandCapabilityUpdated
Occurs when the custom command capability is updated.
Declaration
public event EventHandler<CustomCommandCapabilityUpdatedEventArgs> CustomCommandCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><CustomCommandCapabilityUpdatedEventArgs> |
CustomCommandReceived
Occurs when a server sends custom event.
Declaration
public event EventHandler<CustomCommandReceivedEventArgs> CustomCommandReceived
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><CustomCommandReceivedEventArgs> |
DisplayModeCapabilityUpdated
Occurs when the display mode capability is updated.
Declaration
public event EventHandler<DisplayModeCapabilityUpdatedEventArgs> DisplayModeCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><DisplayModeCapabilityUpdatedEventArgs> |
DisplayModeUpdated
Occurs when the display mode is updated.
Declaration
public event EventHandler<DisplayModeUpdatedEventArgs> DisplayModeUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><DisplayModeUpdatedEventArgs> |
DisplayRotationCapabilityUpdated
Occurs when the display rotation capability is updated.
Declaration
public event EventHandler<DisplayRotationCapabilityUpdatedEventArgs> DisplayRotationCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><DisplayRotationCapabilityUpdatedEventArgs> |
DisplayRotationUpdated
Occurs when the display rotation is updated.
Declaration
public event EventHandler<DisplayRotationUpdatedEventArgs> DisplayRotationUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><DisplayRotationUpdatedEventArgs> |
MetadataUpdated
Occurs when the metadata is updated.
Declaration
public event EventHandler<MetadataUpdatedEventArgs> MetadataUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><MetadataUpdatedEventArgs> |
Mode360CapabilityUpdated
Occurs when the mode360 capability is updated.
Declaration
public event EventHandler<Mode360CapabilityUpdatedEventArgs> Mode360CapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Mode360CapabilityUpdatedEventArgs> |
Mode360Updated
Occurs when the 360 mode is updated.
Declaration
public event EventHandler<Mode360UpdatedEventArgs> Mode360Updated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><Mode360UpdatedEventArgs> |
PlaybackCapabilityUpdated
Occurs when the playback capabilities are updated.
Declaration
public event EventHandler<PlaybackCapabilityUpdatedEventArgs> PlaybackCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PlaybackCapabilityUpdatedEventArgs> |
PlaybackPositionCapabilityUpdated
Occurs when the playback position capability is updated.
Declaration
public event EventHandler<PlaybackPositionCapabilityUpdatedEventArgs> PlaybackPositionCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PlaybackPositionCapabilityUpdatedEventArgs> |
PlaybackStateUpdated
Occurs when the playback state is updated.
Declaration
public event EventHandler<PlaybackStateUpdatedEventArgs> PlaybackStateUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PlaybackStateUpdatedEventArgs> |
PlaylistCapabilityUpdated
Occurs when the playlist capability is updated.
Declaration
public event EventHandler<PlaylistCapabilityUpdatedEventArgs> PlaylistCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PlaylistCapabilityUpdatedEventArgs> |
PlaylistUpdated
Occurs when the playlist is updated.
Declaration
public event EventHandler<PlaylistUpdatedEventArgs> PlaylistUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PlaylistUpdatedEventArgs> |
RepeatModeCapabilityUpdated
Occurs when the repeat mode capability is updated.
Declaration
public event EventHandler<RepeatModeCapabilityUpdatedEventArgs> RepeatModeCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><RepeatModeCapabilityUpdatedEventArgs> |
RepeatModeUpdated
Occurs when the repeat mode is updated.
Declaration
public event EventHandler<RepeatModeUpdatedEventArgs> RepeatModeUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><RepeatModeUpdatedEventArgs> |
SearchCapabilityUpdated
Occurs when the search capability is updated.
Declaration
public event EventHandler<SearchCapabilityUpdatedEventArgs> SearchCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><SearchCapabilityUpdatedEventArgs> |
ServerStopped
Occurs when the server is stopped.
Declaration
public event EventHandler ServerStopped
Event Type
Type | Description |
---|---|
System.EventHandler |
ShuffleModeCapabilityUpdated
Occurs when the shuffle mode capability is updated.
Declaration
public event EventHandler<ShuffleModeCapabilityUpdatedEventArgs> ShuffleModeCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><ShuffleModeCapabilityUpdatedEventArgs> |
ShuffleModeUpdated
Occurs when the shuffle mode is updated.
Declaration
public event EventHandler<ShuffleModeUpdatedEventArgs> ShuffleModeUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><ShuffleModeUpdatedEventArgs> |
SubtitleCapabilityUpdated
Occurs when the subtitle capability is updated.
Declaration
public event EventHandler<SubtitleCapabilityUpdatedEventArgs> SubtitleCapabilityUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><SubtitleCapabilityUpdatedEventArgs> |
SubtitleModeUpdated
Occurs when the subtitle mode is updated.
Declaration
public event EventHandler<SubtitleModeUpdatedEventArgs> SubtitleModeUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><SubtitleModeUpdatedEventArgs> |