X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.Multimedia.MediaPlayer%2FPlayer%2FPlayer.cs;h=c1670ac8ca3734e8daaefbc95caf4f5d2bec3a18;hb=22d0e7e9bc48be39e82330147bbf4e562caf7889;hp=7dd403568817ee139be65822a7f60198ad1ff860;hpb=e502b2a83cdb78162317807da2120de3a6df8704;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git
diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs
index 7dd4035..c1670ac 100644
--- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs
+++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs
@@ -20,6 +20,7 @@ using System.Diagnostics;
using System.IO;
using System.Threading;
using static Interop;
+using System.ComponentModel;
namespace Tizen.Multimedia
{
@@ -43,6 +44,7 @@ namespace Tizen.Multimedia
///
/// Initializes a new instance of the class.
///
+ /// 3
public Player()
{
NativePlayer.Create(out _handle).ThrowIfFailed("Failed to create player");
@@ -51,12 +53,12 @@ namespace Tizen.Multimedia
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();
}
@@ -86,6 +88,7 @@ namespace Tizen.Multimedia
///
/// Releases all resources used by the current instance.
///
+ /// 3
public void Dispose()
{
Dispose(true);
@@ -138,11 +141,12 @@ namespace Tizen.Multimedia
/// The containing current download progress.
/// The player must be in the or state.
///
- /// The player is not streaming.\n
- /// -or-\n
+ /// The player is not streaming.
+ /// -or-
/// The player is not in the valid state.
///
/// The player has already been disposed of.
+ /// 3
public DownloadProgress GetDownloadProgress()
{
ValidatePlayerState(PlayerState.Playing, PlayerState.Paused);
@@ -167,7 +171,8 @@ namespace Tizen.Multimedia
/// The player has already been disposed of.
/// is an empty string.
/// The specified path does not exist.
- /// The path is null.
+ /// is null.
+ /// 3
public void SetSubtitle(string path)
{
ValidateNotDisposed();
@@ -197,6 +202,7 @@ namespace Tizen.Multimedia
/// The player must be in the state.
/// The player has already been disposed of.
/// The player is not in the valid state.
+ /// 3
public void ClearSubtitle()
{
ValidatePlayerState(PlayerState.Idle);
@@ -212,11 +218,12 @@ namespace Tizen.Multimedia
/// The player must be in the or state.
/// The player has already been disposed of.
///
- /// The player is not in the valid state.\n
- /// -or-\n
+ /// The player is not in the valid state.
+ /// -or-
/// No subtitle is set.
///
///
+ /// 3
public void SetSubtitleOffset(int offset)
{
ValidatePlayerState(PlayerState.Playing, PlayerState.Paused);
@@ -239,6 +246,7 @@ namespace Tizen.Multimedia
///
/// Called when the is invoked.
///
+ /// 3
protected virtual void OnPreparing()
{
RegisterEvents();
@@ -253,6 +261,7 @@ namespace Tizen.Multimedia
/// No source is set.
/// The player has already been disposed of.
/// The player is not in the valid state.
+ /// 3
public virtual Task PrepareAsync()
{
if (_source == null)
@@ -262,6 +271,8 @@ namespace Tizen.Multimedia
ValidatePlayerState(PlayerState.Idle);
+ SetDisplay(_display).ThrowIfFailed("Failed to configure display of the player");
+
OnPreparing();
var completionSource = new TaskCompletionSource();
@@ -299,6 +310,7 @@ namespace Tizen.Multimedia
///
/// The player has already been disposed of.
/// The player is not in the valid state.
+ /// 3
public virtual void Unprepare()
{
if (State == PlayerState.Idle)
@@ -317,6 +329,7 @@ namespace Tizen.Multimedia
/// Called after the is unprepared.
///
///
+ /// 3
protected virtual void OnUnprepared()
{
_source?.DetachFrom(this);
@@ -328,8 +341,8 @@ namespace Tizen.Multimedia
///
///
/// The player must be in the or state.
- /// It has no effect if the player is already in the state.\n
- /// \n
+ /// It has no effect if the player is already in the state.
+ ///
/// Sound can be mixed with other sounds if you don't control the stream focus using .
///
/// The player has already been disposed of.
@@ -339,6 +352,7 @@ namespace Tizen.Multimedia
///
///
///
+ /// 3
public virtual void Start()
{
if (State == PlayerState.Playing)
@@ -362,6 +376,7 @@ namespace Tizen.Multimedia
/// The player is not in the valid state.
///
///
+ /// 3
public virtual void Stop()
{
if (State == PlayerState.Ready)
@@ -384,6 +399,7 @@ namespace Tizen.Multimedia
/// The player has already been disposed of.
/// The player is not in the valid state.
///
+ /// 3
public virtual void Pause()
{
if (State == PlayerState.Paused)
@@ -406,11 +422,12 @@ namespace Tizen.Multimedia
/// The player must be in the state.
/// The player has already been disposed of.
///
- /// The player is not in the valid state.\n
- /// -or-\n
+ /// The player is not in the valid state.
+ /// -or-
/// It is not able to assign the source to the player.
///
///
+ /// 3
public void SetSource(MediaSource source)
{
ValidatePlayerState(PlayerState.Idle);
@@ -437,9 +454,10 @@ namespace Tizen.Multimedia
/// The player has already been disposed of.
/// The player is not in the valid state.
/// The required feature is not supported.
+ /// 3
public async Task CaptureVideoAsync()
{
- ValidationUtil.ValidateFeatureSupported(Features.RawVideo);
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.RawVideo);
ValidatePlayerState(PlayerState.Playing, PlayerState.Paused);
@@ -472,6 +490,7 @@ namespace Tizen.Multimedia
/// The player has already been disposed of.
/// The player is not in the valid state.
///
+ /// 3
public int GetPlayPosition()
{
ValidatePlayerState(PlayerState.Ready, PlayerState.Paused, PlayerState.Playing);
@@ -519,11 +538,12 @@ namespace Tizen.Multimedia
/// The player is not in the valid state.
/// The specified position is not valid.
///
+ /// 3
public async Task SetPlayPositionAsync(int position, bool accurate)
{
ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
- var taskCompletionSource = new TaskCompletionSource();
+ var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
bool immediateResult = _source is MediaStreamSource;
@@ -552,17 +572,18 @@ namespace Tizen.Multimedia
///
/// The player has already been disposed of.
///
- /// The player is not in the valid state.\n
- /// -or-\n
+ /// The player is not in the valid state.
+ /// -or-
/// Streaming playback.
///
///
- /// is less than 5.0.\n
- /// -or-\n
- /// is greater than 5.0.\n
- /// -or-\n
+ /// is less than 5.0.
+ /// -or-
+ /// is greater than 5.0.
+ /// -or-
/// is zero.
///
+ /// 3
public void SetPlaybackRate(float rate)
{
if (rate < -5.0F || 5.0F < rate || rate == 0.0F)
@@ -580,17 +601,17 @@ namespace Tizen.Multimedia
///
/// The to apply.
///
- /// The player must be in the state.\n
- /// \n
- /// does not support all .\n
+ /// The player must be in the state.
+ ///
+ /// does not support all .
/// Supported types are , ,
/// , ,
/// , ,
/// and .
///
///
- /// The player has already been disposed of.\n
- /// -or-\n
+ /// The player has already been disposed of.
+ /// -or-
/// has already been disposed of.
///
/// The player is not in the valid state.
@@ -599,6 +620,7 @@ namespace Tizen.Multimedia
/// of is not supported by .
///
///
+ /// 3
public void ApplyAudioStreamPolicy(AudioStreamPolicy policy)
{
if (policy == null)
@@ -637,6 +659,8 @@ namespace Tizen.Multimedia
///
/// This method supports the product infrastructure and is not intended to be used directly from application code.
///
+ /// 4
+ [EditorBrowsable(EditorBrowsableState.Never)]
protected static Exception GetException(int errorCode, string message) =>
((PlayerErrorCode)errorCode).GetException(message);
}