[MediaPlayer] modify the precondition of Start method (#359)
authornam <36914158+kqjy777@users.noreply.github.com>
Wed, 1 Aug 2018 04:54:36 +0000 (13:54 +0900)
committerGitHub <noreply@github.com>
Wed, 1 Aug 2018 04:54:36 +0000 (13:54 +0900)
* [MediaPlayer] modify the precondition of Start method

* fix wrong description

* devide paragraph

src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs
src/Tizen.Multimedia.MediaPlayer/Player/Player.cs

index 00b5927..9ec8ac6 100644 (file)
@@ -35,7 +35,7 @@ namespace Tizen.Multimedia
         /// </summary>
         /// <param name="preBufferMillisecond">A duration of buffering data that must be prerolled to start playback.</param>
         /// <param name="reBufferMillisecond">A duration of buffering data that must be prerolled to resume playback
-        /// if player enters pause state for buffering.</param>
+        /// if player is paused for buffering internally.</param>
         /// <since_tizen> 5 </since_tizen>
         public PlayerBufferingTime(int preBufferMillisecond, int reBufferMillisecond)
         {
index 06c6165..3390ed9 100644 (file)
@@ -380,10 +380,15 @@ namespace Tizen.Multimedia
         /// Starts or resumes playback.
         /// </summary>
         /// <remarks>
-        /// The player must be in the <see cref="PlayerState.Ready"/> or <see cref="PlayerState.Paused"/> state.
-        /// It has no effect if the player is already in the <see cref="PlayerState.Playing"/> state.<br/>
-        /// <br/>
-        /// Sound can be mixed with other sounds if you don't control the stream focus using <see cref="ApplyAudioStreamPolicy"/>.
+        /// Sound can be mixed with other sounds if you don't control the stream focus using <see cref="ApplyAudioStreamPolicy"/>.<br/>
+        ///      <para>Before Tizen 5.0, The player must be in the <see cref="PlayerState.Ready"/> or <see cref="PlayerState.Paused"/> state.
+        ///      It has no effect if the player is already in the <see cref="PlayerState.Playing"/> state.</para>
+        ///      <para>Since Tizen 5.0, The player must be in the <see cref="PlayerState.Ready"/>, <see cref="PlayerState.Playing"/>,
+        ///      or <see cref="PlayerState.Paused"/> state.<br/>
+        ///      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 <see cref="BufferingProgressChanged"/> will be stopped.<br/>
+        ///      In other cases, the player will keep playing without returning error.</para>
         /// </remarks>
         /// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
         /// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
@@ -392,15 +397,11 @@ namespace Tizen.Multimedia
         /// <seealso cref="Pause"/>
         /// <seealso cref="PlaybackCompleted"/>
         /// <seealso cref="ApplyAudioStreamPolicy"/>
+        /// <seealso cref="BufferingProgressChanged"/>
         /// <since_tizen> 3 </since_tizen>
         public virtual void Start()
         {
-            if (State == PlayerState.Playing)
-            {
-                Log.Warn(PlayerLog.Tag, "playing state already");
-                return;
-            }
-            ValidatePlayerState(PlayerState.Ready, PlayerState.Paused);
+            ValidatePlayerState(PlayerState.Ready, PlayerState.Paused, PlayerState.Playing);
 
             NativePlayer.Start(Handle).ThrowIfFailed(this, "Failed to start the player");
         }