From 0bb9201ccb3378787a5d4893e5f8ee3cb3de7a12 Mon Sep 17 00:00:00 2001 From: coderhyme Date: Tue, 9 Jan 2018 19:00:08 +0900 Subject: [PATCH] [MediaPlayer] Added feature tag on the ApplyAudioStreamPolicy method. (#16) Signed-off-by: coderhyme --- src/Tizen.Multimedia.MediaPlayer/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 c1670ac..a98069e 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs @@ -617,12 +617,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)); @@ -630,8 +635,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.7.4