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.

C#
Copy
public class MediaController
Inheritance
object
MediaController

Properties

View Source

IsStopped

Gets a value indicating whether the sever has been stopped.

Declaration
C#
Copy
public bool IsStopped { get; }
Property Value
Type Description
bool

true if the server has been stopped; otherwise, false.

View Source

ServerAppId

Gets the application id of the server.

Declaration
C#
Copy
public string ServerAppId { get; }
Property Value
Type Description
string

The server application id.

Methods

View Source

GetAgeRatingOfCurrentPlayingMedia()

Gets the age rating of current playing media.

Declaration
C#
Copy
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.
-or-
An internal error occurs.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetContentTypeOfCurrentPlayingMedia()

Gets the content type of current playing media.

Declaration
C#
Copy
public MediaControlContentType GetContentTypeOfCurrentPlayingMedia()
Returns
Type Description
MediaControlContentType

The MediaControlContentType.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetCustomCommandCapability()

Gets the value whether the custom command is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetCustomCommandCapability()
Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetDisplayMode()

Gets the current display mode.

Declaration
C#
Copy
public MediaControlDisplayMode GetDisplayMode()
Returns
Type Description
MediaControlDisplayMode

The MediaControlDisplayMode.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetDisplayModeCapability()

Gets the value whether the repeat mode is supported or not.

Declaration
C#
Copy
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.
-or-
An internal error occurs.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetDisplayRotation()

Gets the current display rotation.

Declaration
C#
Copy
public Rotation GetDisplayRotation()
Returns
Type Description
Rotation

The Rotation.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetDisplayRotationCapability()

Gets the value whether the display mode is supported or not.

Declaration
C#
Copy
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.
-or-
An internal error occurs.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetIconPath()

Gets the icon path.

Declaration
C#
Copy
public string GetIconPath()
Returns
Type Description
string

The icon path.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetIndexOfCurrentPlayingMedia()

Returns the index of current playing media.

Declaration
C#
Copy
public string GetIndexOfCurrentPlayingMedia()
Returns
Type Description
string

The index of current playing media.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetMetadata()

Returns the metadata set by the server.

Declaration
C#
Copy
public MediaControlMetadata GetMetadata()
Returns
Type Description
MediaControlMetadata

The metadata.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetMode360Capability()

Gets the value whether the 360 mode is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetMode360Capability()
Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetPlaybackCapabilities()

Gets the value whether MediaControlPlaybackCommand is supported or not.

Declaration
C#
Copy
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.
-or-
An internal error occurs.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetPlaybackCapability(MediaControlPlaybackCommand)

Gets the value whether action is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetPlaybackCapability(MediaControlPlaybackCommand action)
Parameters
Type Name Description
MediaControlPlaybackCommand action

A playback command.

Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.ArgumentException

action is not valid.

System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetPlaybackPosition()

Returns the playback position set by the server.

Declaration
C#
Copy
public long GetPlaybackPosition()
Returns
Type Description
long

The playback position in milliseconds.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetPlaybackPositionCapability()

Gets the value whether the playback position is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetPlaybackPositionCapability()
Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetPlaybackState()

Returns the playback state set by the server.

Declaration
C#
Copy
public MediaControlPlaybackState GetPlaybackState()
Returns
Type Description
MediaControlPlaybackState

The playback state.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetPlaylistCapability()

Gets the value whether the playlist is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetPlaylistCapability()
Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetPlaylistOfCurrentPlayingMedia()

Returns the playlist name of current playing media.

Declaration
C#
Copy
public MediaControlPlaylist GetPlaylistOfCurrentPlayingMedia()
Returns
Type Description
MediaControlPlaylist

The playlist name.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetPlaylists()

Returns the all playlists.

Declaration
C#
Copy
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.
-or-
An internal error occurs.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetRepeatMode()

Returns the repeat mode.

Declaration
C#
Copy
public MediaControlRepeatMode GetRepeatMode()
Returns
Type Description
MediaControlRepeatMode

A MediaControlRepeatMode set by the server.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetRepeatModeCapability()

Gets the value whether the repeat mode is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetRepeatModeCapability()
Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetSearchCapability()

Gets the value whether the search is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetSearchCapability()
Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetShuffleModeCapability()

Gets the value whether the shuffle mode is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetShuffleModeCapability()
Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

GetSubtitleModeCapability()

Gets the value whether the subtitle mode is supported or not.

Declaration
C#
Copy
public MediaControlCapabilitySupport GetSubtitleModeCapability()
Returns
Type Description
MediaControlCapabilitySupport

A MediaControlCapabilitySupport.

Exceptions
Type Condition
System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

IsMode360Enabled()

Gets whether the 360 mode is enabled or not.

Declaration
C#
Copy
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.
-or-
An internal error occurs.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

IsShuffleModeEnabled()

Returns whether the shuffle mode is enabled.

Declaration
C#
Copy
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.
-or-
An internal error occurs.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

IsSubtitleModeEnabled()

Gets whether the subtitle mode is enabled or not.

Declaration
C#
Copy
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.
-or-
An internal error occurs.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

RequestAsync(Command)

Requests command to the server.

Declaration
C#
Copy
[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

command is null.

System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

RequestCommandAsync(Command)

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

Declaration
C#
Copy
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.
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 is null.

System.InvalidOperationException

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

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

View Source

Response(Command, int, Bundle)

Sends the result of each command.

Declaration
C#
Copy
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 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.

View Source

Response(Command, int)

Sends the result of each command.

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

The command that return to client.

int 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.

View Source

Response(Command, MediaControlResult, Bundle)

Sends the result of each command.

Declaration
C#
Copy
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 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.

View Source

Response(Command, MediaControlResult)

Sends the result of each command.

Declaration
C#
Copy
public 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.

View Source

SendPlaybackCommand(MediaControlPlaybackCommand)

Sends playback command to the server.

Declaration
C#
Copy
[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.
-or-
An internal error occurs.

System.ArgumentException

command is not valid.

System.ObjectDisposedException

The MediaControllerManager has already been disposed.

Events

View Source

CustomCommandCapabilityUpdated

Occurs when the custom command capability is updated.

Declaration
C#
Copy
public event EventHandler<CustomCommandCapabilityUpdatedEventArgs> CustomCommandCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><CustomCommandCapabilityUpdatedEventArgs>
View Source

CustomCommandReceived

Occurs when a server sends custom event.

Declaration
C#
Copy
public event EventHandler<CustomCommandReceivedEventArgs> CustomCommandReceived
Event Type
Type Description
System.EventHandler<TEventArgs><CustomCommandReceivedEventArgs>
View Source

DisplayModeCapabilityUpdated

Occurs when the display mode capability is updated.

Declaration
C#
Copy
public event EventHandler<DisplayModeCapabilityUpdatedEventArgs> DisplayModeCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><DisplayModeCapabilityUpdatedEventArgs>
View Source

DisplayModeUpdated

Occurs when the display mode is updated.

Declaration
C#
Copy
public event EventHandler<DisplayModeUpdatedEventArgs> DisplayModeUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><DisplayModeUpdatedEventArgs>
View Source

DisplayRotationCapabilityUpdated

Occurs when the display rotation capability is updated.

Declaration
C#
Copy
public event EventHandler<DisplayRotationCapabilityUpdatedEventArgs> DisplayRotationCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><DisplayRotationCapabilityUpdatedEventArgs>
View Source

DisplayRotationUpdated

Occurs when the display rotation is updated.

Declaration
C#
Copy
public event EventHandler<DisplayRotationUpdatedEventArgs> DisplayRotationUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><DisplayRotationUpdatedEventArgs>
View Source

MetadataUpdated

Occurs when the metadata is updated.

Declaration
C#
Copy
public event EventHandler<MetadataUpdatedEventArgs> MetadataUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><MetadataUpdatedEventArgs>
View Source

Mode360CapabilityUpdated

Occurs when the mode360 capability is updated.

Declaration
C#
Copy
public event EventHandler<Mode360CapabilityUpdatedEventArgs> Mode360CapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><Mode360CapabilityUpdatedEventArgs>
View Source

Mode360Updated

Occurs when the 360 mode is updated.

Declaration
C#
Copy
public event EventHandler<Mode360UpdatedEventArgs> Mode360Updated
Event Type
Type Description
System.EventHandler<TEventArgs><Mode360UpdatedEventArgs>
View Source

PlaybackCapabilityUpdated

Occurs when the playback capabilities are updated.

Declaration
C#
Copy
public event EventHandler<PlaybackCapabilityUpdatedEventArgs> PlaybackCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><PlaybackCapabilityUpdatedEventArgs>
View Source

PlaybackPositionCapabilityUpdated

Occurs when the playback position capability is updated.

Declaration
C#
Copy
public event EventHandler<PlaybackPositionCapabilityUpdatedEventArgs> PlaybackPositionCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><PlaybackPositionCapabilityUpdatedEventArgs>
View Source

PlaybackStateUpdated

Occurs when the playback state is updated.

Declaration
C#
Copy
public event EventHandler<PlaybackStateUpdatedEventArgs> PlaybackStateUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><PlaybackStateUpdatedEventArgs>
View Source

PlaylistCapabilityUpdated

Occurs when the playlist capability is updated.

Declaration
C#
Copy
public event EventHandler<PlaylistCapabilityUpdatedEventArgs> PlaylistCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><PlaylistCapabilityUpdatedEventArgs>
View Source

PlaylistUpdated

Occurs when the playlist is updated.

Declaration
C#
Copy
public event EventHandler<PlaylistUpdatedEventArgs> PlaylistUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><PlaylistUpdatedEventArgs>
View Source

RepeatModeCapabilityUpdated

Occurs when the repeat mode capability is updated.

Declaration
C#
Copy
public event EventHandler<RepeatModeCapabilityUpdatedEventArgs> RepeatModeCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><RepeatModeCapabilityUpdatedEventArgs>
View Source

RepeatModeUpdated

Occurs when the repeat mode is updated.

Declaration
C#
Copy
public event EventHandler<RepeatModeUpdatedEventArgs> RepeatModeUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><RepeatModeUpdatedEventArgs>
View Source

SearchCapabilityUpdated

Occurs when the search capability is updated.

Declaration
C#
Copy
public event EventHandler<SearchCapabilityUpdatedEventArgs> SearchCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><SearchCapabilityUpdatedEventArgs>
View Source

ServerStopped

Occurs when the server is stopped.

Declaration
C#
Copy
public event EventHandler ServerStopped
Event Type
Type Description
System.EventHandler
View Source

ShuffleModeCapabilityUpdated

Occurs when the shuffle mode capability is updated.

Declaration
C#
Copy
public event EventHandler<ShuffleModeCapabilityUpdatedEventArgs> ShuffleModeCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><ShuffleModeCapabilityUpdatedEventArgs>
View Source

ShuffleModeUpdated

Occurs when the shuffle mode is updated.

Declaration
C#
Copy
public event EventHandler<ShuffleModeUpdatedEventArgs> ShuffleModeUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><ShuffleModeUpdatedEventArgs>
View Source

SubtitleCapabilityUpdated

Occurs when the subtitle capability is updated.

Declaration
C#
Copy
public event EventHandler<SubtitleCapabilityUpdatedEventArgs> SubtitleCapabilityUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><SubtitleCapabilityUpdatedEventArgs>
View Source

SubtitleModeUpdated

Occurs when the subtitle mode is updated.

Declaration
C#
Copy
public event EventHandler<SubtitleModeUpdatedEventArgs> SubtitleModeUpdated
Event Type
Type Description
System.EventHandler<TEventArgs><SubtitleModeUpdatedEventArgs>