From 66e91c15ed7ba2af8108520d15affd3f97beff76 Mon Sep 17 00:00:00 2001 From: coderhyme Date: Thu, 11 Jan 2018 14:17:35 +0900 Subject: [PATCH] [MediaPlayer] Added feature tag on the ApplyAudioStreamPolicy method. (#11) Signed-off-by: coderhyme --- .../Player/Player.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs index 7ddc811ee..466dcb9fa 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs @@ -612,12 +612,17 @@ namespace Tizen.Multimedia /// The player is not in the valid state. /// is null. /// - /// of is not supported by . + /// The required feature is not supported.
+ /// -or-
+ /// of is not supported on the current platform. ///
/// + /// http://tizen.org/feature/multimedia.player.stream_info /// 3 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 -- 2.34.1