[MediaPlayer] Added feature tag on the ApplyAudioStreamPolicy method. (#11) 5.0.0-preview1-00445
authorcoderhyme <jhyo.kim@samsung.com>
Thu, 11 Jan 2018 05:17:35 +0000 (14:17 +0900)
committerGitHub <noreply@github.com>
Thu, 11 Jan 2018 05:17:35 +0000 (14:17 +0900)
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
src/Tizen.Multimedia.MediaPlayer/Player/Player.cs

index 7ddc811ee6d63229143b2a6db9ba68e473e76d9a..466dcb9fa3236085b6ca5ea30ba86265b24cc86b 100644 (file)
@@ -612,12 +612,17 @@ namespace Tizen.Multimedia
         /// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="policy"/> is null.</exception>
         /// <exception cref="NotSupportedException">
-        ///     <see cref="AudioStreamType"/> of <paramref name="policy"/> is not supported by <see cref="Player"/>.
+        ///     The required feature is not supported.<br/>
+        ///     -or-<br/>
+        ///     <see cref="AudioStreamType"/> of <paramref name="policy"/> is not supported on the current platform.
         /// </exception>
         /// <seealso cref="AudioStreamPolicy"/>
+        /// <feature>http://tizen.org/feature/multimedia.player.stream_info</feature>
         /// <since_tizen> 3 </since_tizen>
         public void ApplyAudioStreamPolicy(AudioStreamPolicy policy)
         {
+            ValidationUtil.ValidateFeatureSupported("http://tizen.org/feature/multimedia.player.stream_info");
+
             if (policy == null)
             {
                 throw new ArgumentNullException(nameof(policy));
@@ -625,8 +630,14 @@ namespace Tizen.Multimedia
 
             ValidatePlayerState(PlayerState.Idle);
 
-            NativePlayer.SetAudioPolicyInfo(Handle, policy.Handle).
-                ThrowIfFailed("Failed to set the audio stream policy to the player");
+            var ret = NativePlayer.SetAudioPolicyInfo(Handle, policy.Handle);
+
+            if (ret == PlayerErrorCode.InvalidArgument)
+            {
+                throw new NotSupportedException("The specified policy is not supported on the current system.");
+            }
+
+            ret.ThrowIfFailed("Failed to set the audio stream policy to the player");
         }
         #endregion