/// <summary>
/// Initializes a new instance of the <see cref="Player"/> class.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Player()
{
NativePlayer.Create(out _handle).ThrowIfFailed("Failed to create player");
RetrieveProperties();
- if (Features.IsSupported(Features.AudioEffect))
+ if (Features.IsSupported(PlayerFeatures.AudioEffect))
{
_audioEffect = new AudioEffect(this);
}
- if (Features.IsSupported(Features.RawVideo))
+ if (Features.IsSupported(PlayerFeatures.RawVideo))
{
RegisterVideoFrameDecodedCallback();
}
/// <summary>
/// Releases all resources used by the current instance.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void Dispose()
{
Dispose(true);
/// The player is not in the valid state.
/// </exception>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
+ /// <since_tizen> 3 </since_tizen>
public DownloadProgress GetDownloadProgress()
{
ValidatePlayerState(PlayerState.Playing, PlayerState.Paused);
/// <exception cref="ArgumentException"><paramref name="path"/> is an empty string.</exception>
/// <exception cref="FileNotFoundException">The specified path does not exist.</exception>
/// <exception cref="ArgumentNullException"><paramref name="path"/> is null.</exception>
+ /// <since_tizen> 3 </since_tizen>
public void SetSubtitle(string path)
{
ValidateNotDisposed();
/// <remarks>The player must be in the <see cref="PlayerState.Idle"/> state.</remarks>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
+ /// <since_tizen> 3 </since_tizen>
public void ClearSubtitle()
{
ValidatePlayerState(PlayerState.Idle);
/// No subtitle is set.
/// </exception>
/// <seealso cref="SetSubtitle(string)"/>
+ /// <since_tizen> 3 </since_tizen>
public void SetSubtitleOffset(int offset)
{
ValidatePlayerState(PlayerState.Playing, PlayerState.Paused);
/// <summary>
/// Called when the <see cref="Prepare"/> is invoked.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected virtual void OnPreparing()
{
RegisterEvents();
/// <exception cref="InvalidOperationException">No source is set.</exception>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
+ /// <since_tizen> 3 </since_tizen>
public virtual Task PrepareAsync()
{
if (_source == null)
ValidatePlayerState(PlayerState.Idle);
+ SetDisplay(_display).ThrowIfFailed("Failed to configure display of the player");
+
OnPreparing();
var completionSource = new TaskCompletionSource<bool>();
/// </remarks>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
+ /// <since_tizen> 3 </since_tizen>
public virtual void Unprepare()
{
if (State == PlayerState.Idle)
/// Called after the <see cref="Player"/> is unprepared.
/// </summary>
/// <seealso cref="Unprepare"/>
+ /// <since_tizen> 3 </since_tizen>
protected virtual void OnUnprepared()
{
_source?.DetachFrom(this);
/// <seealso cref="Pause"/>
/// <seealso cref="PlaybackCompleted"/>
/// <seealso cref="ApplyAudioStreamPolicy"/>
+ /// <since_tizen> 3 </since_tizen>
public virtual void Start()
{
if (State == PlayerState.Playing)
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
/// <seealso cref="Start"/>
/// <seealso cref="Pause"/>
+ /// <since_tizen> 3 </since_tizen>
public virtual void Stop()
{
if (State == PlayerState.Ready)
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
/// <seealso cref="Start"/>
+ /// <since_tizen> 3 </since_tizen>
public virtual void Pause()
{
if (State == PlayerState.Paused)
/// It is not able to assign the source to the player.
/// </exception>
/// <seealso cref="PrepareAsync"/>
+ /// <since_tizen> 3 </since_tizen>
public void SetSource(MediaSource source)
{
ValidatePlayerState(PlayerState.Idle);
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
/// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 3 </since_tizen>
public async Task<CapturedFrame> CaptureVideoAsync()
{
- ValidationUtil.ValidateFeatureSupported(Features.RawVideo);
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.RawVideo);
ValidatePlayerState(PlayerState.Playing, PlayerState.Paused);
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
/// <seealso cref="SetPlayPositionAsync(int, bool)"/>
+ /// <since_tizen> 3 </since_tizen>
public int GetPlayPosition()
{
ValidatePlayerState(PlayerState.Ready, PlayerState.Paused, PlayerState.Playing);
/// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
/// <exception cref="ArgumentOutOfRangeException">The specified position is not valid.</exception>
/// <seealso cref="GetPlayPosition"/>
+ /// <since_tizen> 3 </since_tizen>
public async Task SetPlayPositionAsync(int position, bool accurate)
{
ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
/// -or-<br/>
/// <paramref name="rate"/> is zero.
/// </exception>
+ /// <since_tizen> 3 </since_tizen>
public void SetPlaybackRate(float rate)
{
if (rate < -5.0F || 5.0F < rate || rate == 0.0F)
/// <see cref="AudioStreamType"/> of <paramref name="policy"/> is not supported by <see cref="Player"/>.
/// </exception>
/// <seealso cref="AudioStreamPolicy"/>
+ /// <since_tizen> 3 </since_tizen>
public void ApplyAudioStreamPolicy(AudioStreamPolicy policy)
{
if (policy == null)
/// <summary>
/// This method supports the product infrastructure and is not intended to be used directly from application code.
/// </summary>
+ /// <since_tizen> 4 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
protected static Exception GetException(int errorCode, string message) =>
((PlayerErrorCode)errorCode).GetException(message);