Merge "[Player] Added missing comments." into tizen
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.MediaPlayer / Player / Player.cs
index 36be442..814636d 100644 (file)
@@ -264,7 +264,6 @@ namespace Tizen.Multimedia
             {
                 ValidateNotDisposed();
 
-                //TODO is this needed?
                 if (IsPreparing())
                 {
                     return PlayerState.Preparing;
@@ -358,7 +357,6 @@ namespace Tizen.Multimedia
 
         private PlayerErrorCode SetDisplay(Display display)
         {
-            Log.Debug(PlayerLog.Tag, PlayerLog.Enter);
             if (display == null)
             {
                 Log.Info(PlayerLog.Tag, "set display to none");
@@ -370,15 +368,9 @@ namespace Tizen.Multimedia
 
         private void ReplaceDisplay(Display newDisplay)
         {
-            if (_display != null)
-            {
-                _display.Owner = null;
-            }
+            _display?.SetOwner(null);
             _display = newDisplay;
-            if (_display != null)
-            {
-                _display.Owner = this;
-            }
+            _display?.SetOwner(this);
         }
 
         /// <summary>
@@ -397,25 +389,20 @@ namespace Tizen.Multimedia
             }
             set
             {
-                Log.Debug(PlayerLog.Tag, PlayerLog.Enter);
                 ValidatePlayerState(PlayerState.Idle);
 
-                if (value != null && value.Owner != null)
+                if (value?.Owner != null)
                 {
                     if (ReferenceEquals(this, value.Owner))
                     {
                         return;
                     }
-                    else
-                    {
-                        throw new ArgumentException("The display has already been assigned to another.");
-                    }
-                }
 
+                    throw new ArgumentException("The display has already been assigned to another.");
+                }
                 SetDisplay(value).ThrowIfFailed("Failed to set the display to the player");
 
                 ReplaceDisplay(value);
-                Log.Debug(PlayerLog.Tag, PlayerLog.Leave);
             }
         }
 
@@ -816,13 +803,14 @@ namespace Tizen.Multimedia
             _source = null;
         }
 
-        //TODO remarks needs to be updated. see the native reference.
         /// <summary>
         /// 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.
+        /// It has no effect if the player is already in the <see cref="PlayerState.Playing"/> state.\n
+        /// \n
+        /// Sound can be mixed with other sounds if you don't control the stream focus using <see cref="ApplyAudioStreamPolicy"/>.
         /// </remarks>
         /// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
         /// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
@@ -830,6 +818,7 @@ namespace Tizen.Multimedia
         /// <seealso cref="Stop"/>
         /// <seealso cref="Pause"/>
         /// <seealso cref="PlaybackCompleted"/>
+        /// <seealso cref="ApplyAudioStreamPolicy"/>
         public virtual void Start()
         {
             Log.Debug(PlayerLog.Tag, PlayerLog.Enter);