Class MediaController

Definition

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

Provides a means to send commands to and handle events from media control server.

C#
Copy
public class MediaController
Inheritance
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
Boolean

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

API Level: 4
View Source

ServerAppId

Gets the application id of the server.

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

The server application id.

API Level: 4

Methods

View Source

GetAgeRatingOfCurrentPlayingMedia()

Gets the age rating of current playing media.

Declaration
C#
Copy
public int GetAgeRatingOfCurrentPlayingMedia()
Returns
Type Description
System.Int32

The Age rating of current playing media. The range is 0 to 19, inclusive.

Exceptions
Type Condition
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
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
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
View Source

GetIconPath()

Gets the icon path.

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

The icon path.

Exceptions
Type Condition
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
View Source

GetIndexOfCurrentPlayingMedia()

Returns the index of current playing media.

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

The index of current playing media.

Exceptions
Type Condition
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
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
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 4
View Source

GetPlaybackCapabilities()

Gets the value whether MediaControlPlaybackCommand is supported or not.

Declaration
C#
Copy
public Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport> GetPlaybackCapabilities()
Returns
Type Description
Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport>

the set of MediaControlPlaybackCommand and MediaControlCapabilitySupport.

Exceptions
Type Condition
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
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.

InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
View Source

GetPlaybackPosition()

Returns the playback position set by the server.

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

The playback position in milliseconds.

Exceptions
Type Condition
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 4
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
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 4
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
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
View Source

GetPlaylists()

Returns the all playlists.

Declaration
C#
Copy
public IEnumerable<MediaControlPlaylist> GetPlaylists()
Returns
Type Description
System.Collections.Generic.IEnumerable<MediaControlPlaylist>

The set of MediaControlPlaylist.

Exceptions
Type Condition
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
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
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 4
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
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
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
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
View Source

IsShuffleModeEnabled()

Returns whether the shuffle mode is enabled.

Declaration
C#
Copy
public bool IsShuffleModeEnabled()
Returns
Type Description
Boolean

A value indicating whether the shuffle mode is enabled.

Exceptions
Type Condition
InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 4
View Source

RequestAsync(Command)

Requests command to the server.

Declaration
C#
Copy
public Task<Bundle> RequestAsync(Command command)
Parameters
Type Name Description
Command command

A Command class.

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

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

Remarks

The client can request the server to execute PlaybackCommand or ShuffleModeCommand or RepeatModeCommand or CustomCommand,
and then, the client receive the result of each request(command).

Exceptions
Type Condition
ArgumentNullException

command is null.

InvalidOperationException

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

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 5
View Source

Response(Command, Int32)

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.

System.Int32 result

The result of command.

Exceptions
Type Condition
ArgumentNullException

command is null.

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 void Response(Command command, int result, Bundle bundle)
Parameters
Type Name Description
Command command

The command that return to client.

System.Int32 result

The result of command.

Bundle bundle

The extra data.

Exceptions
Type Condition
ArgumentNullException

command is null.

InvalidOperationException

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

API Level: 5
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
InvalidOperationException

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

System.ArgumentException

command is not valid.

ObjectDisposedException

The MediaControllerManager has already been disposed of.

API Level: 4

Events

View Source

CustomCommandReceived

Occurs when a server sends custom event.

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

MetadataUpdated

Occurs when the metadata is updated.

Declaration
C#
Copy
public event EventHandler<MetadataUpdatedEventArgs> MetadataUpdated
Event Type
Type Description
System.EventHandler<MetadataUpdatedEventArgs>
API Level: 4
View Source

PlaybackCapabilityUpdated

Occurs when the playback capabilities are updated.

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

PlaybackStateUpdated

Occurs when the playback state is updated.

Declaration
C#
Copy
public event EventHandler<PlaybackStateUpdatedEventArgs> PlaybackStateUpdated
Event Type
Type Description
System.EventHandler<PlaybackStateUpdatedEventArgs>
API Level: 4
View Source

PlaylistUpdated

Occurs when the playlist is updated.

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

RepeatModeCapabilityUpdated

Occurs when the repeat mode capabilities are updated.

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

RepeatModeUpdated

Occurs when the repeat mode is updated.

Declaration
C#
Copy
public event EventHandler<RepeatModeUpdatedEventArgs> RepeatModeUpdated
Event Type
Type Description
System.EventHandler<RepeatModeUpdatedEventArgs>
API Level: 4
View Source

ServerStopped

Occurs when the server is stopped.

Declaration
C#
Copy
public event EventHandler ServerStopped
Event Type
Type Description
EventHandler
API Level: 4
View Source

ShuffleModeCapabilityUpdated

Occurs when the shuffle mode capabilities are updated.

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

ShuffleModeUpdated

Occurs when the shuffle mode is updated.

Declaration
C#
Copy
public event EventHandler<ShuffleModeUpdatedEventArgs> ShuffleModeUpdated
Event Type
Type Description
System.EventHandler<ShuffleModeUpdatedEventArgs>
API Level: 4