Class Player
Definition
- Namespace:
- Tizen.Multimedia
- Assembly:
- Tizen.Multimedia.MediaPlayer.dll
Provides the ability to control media playback.
public class Player : IDisposable
- Inheritance
-
objectPlayer
- Implements
-
System.IDisposable
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Constructors
View SourcePlayer()
Initializes a new instance of the Player class.
Declaration
public Player()
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Properties
View SourceAdaptiveVariants
Gets the adaptive variants of the player.
Declaration
public AdaptiveVariants AdaptiveVariants { get; }
Property Value
Type | Description |
---|---|
AdaptiveVariants |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
AudioCodecType
Gets or sets the default codec type of the audio decoder.
Declaration
public CodecType AudioCodecType { get; set; }
Property Value
Type | Description |
---|---|
CodecType | A CodecType specifies the type. The default codec type could be different depending on the device capability. |
Remarks
To set, the player must be in the Idle state.
If H/W audio codec type is not supported in some cases, S/W audio codec type could be used instead.
The availability could be changed depending on the codec capability.
If an application wants to use the H/W audio codec type as default,
The following functions should be called after the codec type is set. :
IsAvailable
EnableExportingAudioData(AudioMediaFormat, PlayerAudioExtractOption)
DisableExportingAudioData()
ReplayGain
AudioPitch
AudioPitchEnabled
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentException | The value is not valid. |
System.InvalidOperationException | The player is not in the valid state.
-or- |
CodecNotSupportedException | The selected codec is not supported. |
AudioEffect
Gets the audio effect of the player.
Declaration
public AudioEffect AudioEffect { get; }
Property Value
Type | Description |
---|---|
AudioEffect |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
AudioLatencyMode
Gets or sets the audio latency mode.
Declaration
public AudioLatencyMode AudioLatencyMode { get; set; }
Property Value
Type | Description |
---|---|
AudioLatencyMode | A AudioLatencyMode that specifies the mode. The default is Mid. |
Remarks
If the mode is High, audio output interval can be increased, so it can keep more audio data to play. But, state transition like pause or resume can be more slower than default(Mid).
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentException | The value is not valid. |
NotAvailableException | If audio offload is enabled by calling IsEnabled. (Since tizen 6.0) |
See Also
View SourceAudioOffload
Gets the audio offload settings of the player.
Declaration
public AudioOffload AudioOffload { get; }
Property Value
Type | Description |
---|---|
AudioOffload |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
AudioPitch
Gets or sets the pitch of the audio.
Declaration
public float AudioPitch { get; set; }
Property Value
Type | Description |
---|---|
float | The audio stream pitch value. The default is 1. |
Remarks
Enabling pitch control could increase the CPU usage on some devices. This function is used for audio content only. This function could be unavailable depending on the audio codec type.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | A pitch is not enabled. |
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentOutOfRangeException | value is less than 0.5.
-or- |
NotAvailableException | If audio offload is enabled by calling IsEnabled. (Since tizen 6.0)
-or- |
See Also
View SourceAudioPitchEnabled
Gets or sets a value indicating whether the audio pitch control is enabled.
Declaration
public bool AudioPitchEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool | The value indicating whether or not AudioPitch is enabled. The default is false. |
Remarks
This function is used for audio content only. To set, the player must be in the Idle state. This function could be unavailable depending on the audio codec type.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The player is not in the valid state. |
System.ObjectDisposedException | The player has already been disposed of. |
NotAvailableException | If audio offload is enabled by calling IsEnabled. (Since tizen 6.0)
-or- |
See Also
View SourceAudioTrackInfo
Gets the audio track information of the player.
Declaration
public PlayerTrackInfo AudioTrackInfo { get; }
Property Value
Type | Description |
---|---|
PlayerTrackInfo | A PlayerTrackInfo for audio. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
BufferingTime
Gets or sets the streaming buffering time.
Declaration
public PlayerBufferingTime BufferingTime { get; set; }
Property Value
Type | Description |
---|---|
PlayerBufferingTime |
Remarks
To set, the player must be in the Idle state.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The player is not in the valid state. |
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentOutOfRangeException |
|
System.NotSupportedException | The required feature is not supported. |
See Also
View SourceCookie
Gets or sets the cookie for streaming playback.
Declaration
public string Cookie { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
To set, the player must be in the Idle state.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The player is not in the valid state. |
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentNullException | The value to set is null. |
Display
Gets or sets the display of the player.
Declaration
public Display Display { get; set; }
Property Value
Type | Description |
---|---|
Display | A Display that specifies the display. |
Remarks
The player must be in the Idle state.
The raw video feature(http://tizen.org/feature/multimedia.raw_video) is required if
the display is created with MediaView.
If a user wants to use video and UI sync mode, please use Display(Window, bool).(Since tizen 6.5)
But DisplaySettings is not supported in UI sync mode.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentException | The value has already been assigned to another player. |
System.InvalidOperationException | The player is not in the valid state. |
System.NotSupportedException | The required feature is not supported. |
DisplaySettings
Gets the display settings of the player.
Declaration
public PlayerDisplaySettings DisplaySettings { get; }
Property Value
Type | Description |
---|---|
PlayerDisplaySettings | A PlayerDisplaySettings that specifies the display settings. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Handle
Gets the native handle of the player.
Declaration
public IntPtr Handle { get; }
Property Value
Type | Description |
---|---|
System.IntPtr | An IntPtr that contains the native handle of the player. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
IsAudioOnly
Gets or sets a value indicating whether the player is in audio only mode.
Declaration
public bool IsAudioOnly { get; set; }
Property Value
Type | Description |
---|---|
bool | true if the playback is audio-only mode; otherwise, false. The default value is false. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The player is not in the valid state. |
System.ObjectDisposedException | The player has already been disposed of. |
IsLooping
Gets or sets a value indicationg whether the media source is played in a loop.
Declaration
public bool IsLooping { get; set; }
Property Value
Type | Description |
---|---|
bool | true if the playback is looping; otherwise, false. The default value is false. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
Muted
Gets or sets a value indicationg whether the audio output of the player is muted.
Declaration
public bool Muted { get; set; }
Property Value
Type | Description |
---|---|
bool | true if the player is muted; otherwise, false. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
ReplayGain
Gets or sets a value indicating whether the replay gain is enabled.
Declaration
public bool ReplayGain { get; set; }
Property Value
Type | Description |
---|---|
bool | If the replaygain status is true, replaygain is applied (if contents has a replaygain tag); otherwise, the replaygain is not affected by tag and properties. |
Remarks
This function could be unavailable depending on the audio codec type.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
NotAvailableException | If audio offload is enabled by calling IsEnabled. (Since tizen 6.0)
-or- |
See Also
View SourceSphericalVideo
Gets the spherical video porperties of the player.
Declaration
public SphericalVideo SphericalVideo { get; }
Property Value
Type | Description |
---|---|
SphericalVideo |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
State
Gets the current state of the player.
Declaration
public PlayerState State { get; }
Property Value
Type | Description |
---|---|
PlayerState | The current state of the player. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
StreamInfo
Gets the stream information of the player.
Declaration
public StreamInfo StreamInfo { get; }
Property Value
Type | Description |
---|---|
StreamInfo | A StreamInfo for this player. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
SubtitleTrackInfo
Gets the sutitle track information of the player.
Declaration
public PlayerTrackInfo SubtitleTrackInfo { get; }
Property Value
Type | Description |
---|---|
PlayerTrackInfo | A PlayerTrackInfo for the subtitle. |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
UserAgent
Gets or sets the user agent for streaming playback.
Declaration
public string UserAgent { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
To set, the player must be in the Idle state.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The player is not in the valid state. |
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentNullException | The value to set is null. |
VideoCodecType
Gets or sets the codec type of the video decoder.
Declaration
public CodecType VideoCodecType { get; set; }
Property Value
Type | Description |
---|---|
CodecType | A CodecType specifies the type. The default codec type could be different depending on the device capability. |
Remarks
To set, the player must be in the Idle state.
If H/W video codec type is not supported in some cases, S/W video codec type could be used instead.
The availability could be changed depending on the codec capability.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed. |
System.ArgumentException | The value is not valid. |
System.InvalidOperationException | The player is not in the valid state.
-or- |
CodecNotSupportedException | The selected codec is not supported. |
Volume
Gets or sets the current volume of the player.
Declaration
public float Volume { get; set; }
Property Value
Type | Description |
---|---|
float |
Remarks
Valid volume range is from 0 to 1.0, inclusive.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentOutOfRangeException |
|
Methods
View SourceApplyAudioStreamPolicy(AudioStreamPolicy)
Applies the specified audio stream policy to the player.
Declaration
public void ApplyAudioStreamPolicy(AudioStreamPolicy policy)
Parameters
Type | Name | Description |
---|---|---|
AudioStreamPolicy | policy | The AudioStreamPolicy to apply. |
Remarks
The player must be in the Idle state.
Player does not support all AudioStreamType.
Supported types are Media, System,
Alarm, Notification,
Emergency, VoiceInformation,
RingtoneVoip and MediaExternalOnly.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
System.ArgumentNullException |
|
System.NotSupportedException | The required feature is not supported. |
See Also
View SourceCaptureVideoAsync()
Captures the current frame of the video being played, asynchronously.
Declaration
public Task<CapturedFrame> CaptureVideoAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><CapturedFrame> | A task that represents the asynchronous capture operation. |
Remarks
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
System.NotSupportedException | The required feature is not supported. |
ClearSubtitle()
Clears the the subtitle path of the media player.
Declaration
public void ClearSubtitle()
Remarks
The player must be in the Idle state.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
DisableExportingAudioData()
Disable to decode an audio data.
Declaration
public void DisableExportingAudioData()
Remarks
The player must be in the Idle or Ready state. This function could be unavailable depending on the audio codec type.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
NotAvailableException | The function is not available depending on the audio codec type. (Since tizen 6.0) |
See Also
View SourceDisableExportingVideoFrame()
Disables to decode a video data.
Declaration
public void DisableExportingVideoFrame()
Remarks
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
See Also
View SourceDispose()
Releases all resources used by the current instance.
Declaration
public void Dispose()
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
EnableExportingAudioData(AudioMediaFormat, PlayerAudioExtractOption)
Enable to decode an audio data for exporting PCM from a data.
Declaration
public void EnableExportingAudioData(AudioMediaFormat format, PlayerAudioExtractOption option)
Parameters
Type | Name | Description |
---|---|---|
AudioMediaFormat | format | The media format handle required to audio PCM specification. The format has to include MimeType, Channel and SampleRate. If the format is NULL, the original PCM format or platform default PCM format will be applied. |
PlayerAudioExtractOption | option | The audio extract option. |
Remarks
The player must be in the Idle state.
A AudioDataDecoded event is called in a separate thread(not in the main loop).
The audio PCM data can be retrieved using a AudioDataDecoded event as a media packet and it is available until it's destroyed by Dispose(). The packet has to be destroyed as quickly as possible after rendering the data and all the packets have to be destroyed before Unprepare() is called.
This function could be unavailable depending on the audio codec type.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentException | The value is not valid. |
System.InvalidOperationException | Operation failed; internal error.
-or- |
NotAvailableException | If audio offload is enabled by calling IsEnabled. (Since tizen 6.0)
-or- |
See Also
View SourceEnableExportingVideoFrame()
Enables to decode a video data for every frame.
Declaration
public void EnableExportingVideoFrame()
Remarks
The player must be in the Idle state, but Display must not be set.
A VideoFrameDecoded event is called in a separate thread, not called in the main loop.
The video frame can be retrieved using a VideoFrameDecoded event with a media packet parameter. If you change the media packet in the VideoFrameDecoded event, it will be displayed on the device. The callback function holds the same buffer that is drawn on the display device. and the MediaPacket is available until it is destroyed by Dispose(). It is recommended to destroy the packet as quickly as possible after the decoded data is rendered on the display. All the packets have to be destroyed before Unprepare() is called.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | Operation failed; internal error.
-or- |
See Also
View SourceGetDownloadProgress()
Gets the download progress of the streaming contents.
Declaration
public DownloadProgress GetDownloadProgress()
Returns
Type | Description |
---|---|
DownloadProgress | The DownloadProgress containing current download progress. |
Remarks
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The player is not streaming. |
System.ObjectDisposedException | The player has already been disposed of. |
GetPlayPosition()
Gets the current playback position in milliseconds of the media.
Declaration
public int GetPlayPosition()
Returns
Type | Description |
---|---|
int | The current position in milliseconds. |
Remarks
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
See Also
GetPlayPositionNanoseconds()
Gets the current playback position in nanoseconds of the media.
Declaration
public long GetPlayPositionNanoseconds()
Returns
Type | Description |
---|---|
long | The current position in nanoseconds. |
Remarks
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
See Also
View SourceGetVideoRoi()
Get the relative ROI (Region Of Interest) area as a decimal fraction based on the video source.
Declaration
public ScaleRectangle GetVideoRoi()
Returns
Type | Description |
---|---|
ScaleRectangle | The ScaleRectangle containing the ROI area information. |
Remarks
The specified ROI area is valid only in Tizen.Multimedia.PlayerDisplayType.Overlay.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | Operation failed; internal error. |
See Also
View SourceOnPreparing()
Called when the Tizen.Multimedia.Player.Prepare is invoked.
Declaration
protected virtual void OnPreparing()
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
OnUnprepared()
Called after the Player is unprepared.
Declaration
protected virtual void OnUnprepared()
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
See Also
View SourcePause()
Pauses playing the media content.
Declaration
public virtual void Pause()
Remarks
The player must be in the Playing state. It has no effect if the player is already in the Paused state.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
See Also
View SourcePrepareAsync()
Prepares the media player for playback, asynchronously.
Declaration
public virtual Task PrepareAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous prepare operation. |
Remarks
To prepare the player, the player must be in the Idle state, and a source must be set.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | No source is set. |
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
See Also
View SourcePrepareAsync(CancellationToken)
Prepares the cancelable media player for playback, asynchronously.
Declaration
public virtual Task PrepareAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The cancellation token to cancel preparing. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task that represents the asynchronous prepare operation. |
Remarks
To prepare the player, the player must be in the Idle state, and a source must be set. The state must be Preparing to cancel preparing. When preparing is cancelled, a state will be changed to Idle from Preparing.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed. |
System.InvalidOperationException | Operation failed; internal error.
-or- |
See Also
View SourceSetPlaybackRate(float)
Sets the playback rate of the player.
Declaration
public void SetPlaybackRate(float rate)
Parameters
Type | Name | Description |
---|---|---|
float | rate | The value for the playback rate. Valid range is -5.0 to 5.0, inclusive. |
Remarks
The player must be in the Ready, Playing, or Paused state.
The sound will be muted, when the playback rate is under 0.0 or over 2.0.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
System.ArgumentOutOfRangeException |
|
NotAvailableException | If audio offload is enabled by calling IsEnabled. (Since tizen 6.0) |
See Also
View SourceSetPlayPositionAsync(int, bool)
Sets the playback position in milliseconds of the player, asynchronously.
Declaration
public Task SetPlayPositionAsync(int position, bool accurate)
Parameters
Type | Name | Description |
---|---|---|
int | position | The value indicating a desired position in milliseconds. |
bool | accurate | The value indicating whether the operation performs with accuracy. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous operation. |
Remarks
The player must be in the Ready, Playing, or Paused state.
If the accurate
is true, the play position will be adjusted as the specified position
value,
but this might be considerably slow. If false, the play position will be a nearest keyframe position.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
System.ArgumentOutOfRangeException | The specified position is not valid. |
See Also
View SourceSetPlayPositionNanosecondsAsync(long, bool)
Sets the playback position in nanoseconds of the player, asynchronously.
Declaration
public Task SetPlayPositionNanosecondsAsync(long position, bool accurate)
Parameters
Type | Name | Description |
---|---|---|
long | position | The value indicating a desired position in nanoseconds. |
bool | accurate | The value indicating whether the operation performs with accuracy. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous operation. |
Remarks
The player must be in the Ready, Playing, or Paused state.
If the accurate
is true, the play position will be adjusted as the specified position
value,
but this might be considerably slow. If false, the play position will be a nearest keyframe position.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
System.ArgumentOutOfRangeException | The specified position is not valid. |
See Also
View SourceSetSource(MediaSource)
Sets a media source for the player.
Declaration
public void SetSource(MediaSource source)
Parameters
Type | Name | Description |
---|---|---|
MediaSource | source | A MediaSource that specifies the source for playback. |
Remarks
The player must be in the Idle state.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
System.UnauthorizedAccessException | Thrown when the permission is denied. |
See Also
View SourceSetSubtitle(string)
Sets the subtitle file path for playback.
Declaration
public void SetSubtitle(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The absolute path of the subtitle file, it can be NULL in the Idle state. |
Remarks
Only MicroDVD/SubViewer(.sub), SAMI(.smi), and SubRip(*.srt) subtitle formats are supported.
The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any files are used to play located in the internal storage. The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any files are used to play located in the external storage.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.ArgumentException |
|
System.IO.FileNotFoundException | The specified path does not exist. |
System.ArgumentNullException |
|
SetSubtitleOffset(int)
Sets the seek offset for the subtitle.
Declaration
public void SetSubtitleOffset(int offset)
Parameters
Type | Name | Description |
---|---|---|
int | offset | The value indicating a desired offset in milliseconds. |
Remarks
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
See Also
View SourceSetVideoRoi(ScaleRectangle)
Set the relative ROI (Region Of Interest) area as a decimal fraction based on the video source. It can be regarded as zooming operation because the specified video area will be rendered to fit to the display.
Declaration
public void SetVideoRoi(ScaleRectangle scaleRectangle)
Parameters
Type | Name | Description |
---|---|---|
ScaleRectangle | scaleRectangle | The containing the ROI area information. |
Remarks
This function requires the ratio of the each coordinate and size to the video resolution size to guarantee of showing the same area for the dynamic resolution video content. This function have to be called after setting Display
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | Operation failed; internal error.
-or- |
System.ArgumentOutOfRangeException |
|
See Also
View SourceStart()
Starts or resumes playing the media content.
Declaration
public virtual void Start()
Remarks
Sound can be mixed with other sounds if you don't control the stream focus using ApplyAudioStreamPolicy(AudioStreamPolicy).
Before Tizen 5.0, The player must be in the Ready or Paused state. It has no effect if the player is already in the Playing state.
Since Tizen 5.0, The player must be in the Ready, Playing,
or Paused state.
In case of HTTP streaming playback, the player could be internally paused for buffering.
If the application calls this function during the buffering, the playback will be resumed by force
and the buffering message posting by BufferingProgressChanged will be stopped.
In other cases, the player will keep playing without returning error.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
See Also
Stop()
Stops playing the media content.
Declaration
public virtual void Stop()
Remarks
The player must be in the Playing or Paused state. It has no effect if the player is already in the Ready state.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
See Also
View SourceUnprepare()
Unprepares the media player.
Declaration
public virtual void Unprepare()
Remarks
The most recently used source is reset and is no longer associated with the player. Playback is no longer possible. If you want to use the player again, you have to set a source and call PrepareAsync() or PrepareAsync(CancellationToken) again.
The player must be in the Ready, Playing, or Paused state. It has no effect if the player is already in the Idle state.
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The player has already been disposed of. |
System.InvalidOperationException | The player is not in the valid state. |
Events
View SourceAudioDataDecoded
Occurs when a audio frame is decoded.
Declaration
public event EventHandler<AudioDataDecodedEventArgs> AudioDataDecoded
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><AudioDataDecodedEventArgs> |
Remarks
The event handler will be executed on an internal thread.
The Packet in event args should be disposed after use.
See Also
View SourceBufferingProgressChanged
Occurs when there is a change in the buffering status of streaming.
Declaration
public event EventHandler<BufferingProgressChangedEventArgs> BufferingProgressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><BufferingProgressChangedEventArgs> |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
ErrorOccurred
Occurs when any error occurs.
Declaration
public event EventHandler<PlayerErrorOccurredEventArgs> ErrorOccurred
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PlayerErrorOccurredEventArgs> |
Remarks
The event handler will be executed on an internal thread.
PlaybackCompleted
Occurs when the playback of a media is finished.
Declaration
public event EventHandler<EventArgs> PlaybackCompleted
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><System.EventArgs> |
Remarks
The player provides functions to play a media content. It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. Note that only one video player can be played at one time.
PlaybackInterrupted
Occurs when the playback of a media is interrupted.
Declaration
public event EventHandler<PlaybackInterruptedEventArgs> PlaybackInterrupted
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PlaybackInterruptedEventArgs> |
Remarks
If the reason is ResourceConflict, the player state will be one of Idle, Ready, or Paused.
See Also
View SourceSubtitleUpdated
Occurs when the subtitle is updated.
Declaration
public event EventHandler<SubtitleUpdatedEventArgs> SubtitleUpdated
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><SubtitleUpdatedEventArgs> |
Remarks
The event handler will be executed on an internal thread.
VideoFrameDecoded
Occurs when a video frame is decoded.
Declaration
public event EventHandler<VideoFrameDecodedEventArgs> VideoFrameDecoded
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><VideoFrameDecodedEventArgs> |
Remarks
The event handler will be executed on an internal thread.
The Packet in event args should be disposed after use.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The required feature is not supported. |
See Also
View SourceVideoStreamChanged
Occurs when the video stream is changed.
Declaration
public event EventHandler<VideoStreamChangedEventArgs> VideoStreamChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><VideoStreamChangedEventArgs> |
Remarks
The event handler will be executed on an internal thread.