From: nam <36914158+aferin@users.noreply.github.com> Date: Wed, 27 Mar 2019 08:51:19 +0000 (+0900) Subject: [MediaPlayer] Modify the range of parameter for buffering API (#748) X-Git-Tag: submit/tizen/20190328.005435~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ac3eb70c53c059c656c6867f39e10c6add8a857;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [MediaPlayer] Modify the range of parameter for buffering API (#748) * [MediaPlayer] Modify the range of parameter for buffering API * state NotSupportedException --- diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs index 0320853ce..058f56afd 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs @@ -34,10 +34,19 @@ namespace Tizen.Multimedia /// Initializes a new instance of the PlayerBufferingTime struct. /// /// A duration of buffering data that must be prerolled to start playback. - /// A duration of buffering data that must be prerolled to resume playback - /// if player is paused for buffering internally. + /// Except 0 and -1, setting at least 1000 milliseconds is recommended to ensure the normal buffering operation. + /// 0 : use platform default value which could be different depending on the streaming type and network status. (the initial value) + /// -1 : use current value. (since 5.5) + /// A duration of buffering data that must be prerolled to resume playback, + /// when player is internally paused for buffering. + /// Except 0 and -1, setting at least 1000 milliseconds is recommended to ensure the normal buffering operation. + /// 0 : use platform default value which could be different depending on the streaming type and network status. (the initial value) + /// -1 : use current value. (since 5.5) + /// 0 means platform default value which could be different depending on the streaming type and network status. + /// If the player state is or , + /// this function will return correct time value instead of 0. (since 5.5) /// 5 - public PlayerBufferingTime(int preBufferMillisecond, int reBufferMillisecond) + public PlayerBufferingTime(int preBufferMillisecond = -1, int reBufferMillisecond = -1) { PreBufferMillisecond = preBufferMillisecond; ReBufferMillisecond = reBufferMillisecond; @@ -85,6 +94,7 @@ namespace Tizen.Multimedia #region Network configuration private string _cookie = ""; private string _userAgent = ""; + private const int MinBufferingTime = -1; /// /// Gets or sets the cookie for streaming playback. @@ -153,10 +163,11 @@ namespace Tizen.Multimedia /// The player is not in the valid state. /// The player has already been disposed of. /// - /// is less than 0.
+ /// is less than -1.
/// -or-
- /// is less than 0.
+ /// is less than -1.
///
+ /// The required feature is not supported. /// /// 5 public PlayerBufferingTime BufferingTime @@ -174,9 +185,10 @@ namespace Tizen.Multimedia { ValidatePlayerState(PlayerState.Idle); - if (value.PreBufferMillisecond < 0 || value.ReBufferMillisecond < 0) + if (value.PreBufferMillisecond < MinBufferingTime || value.ReBufferMillisecond < MinBufferingTime) { - throw new ArgumentOutOfRangeException("invalid range"); + throw new ArgumentOutOfRangeException(nameof(value), value, + $"invalid range, got { value.PreBufferMillisecond }, { value.ReBufferMillisecond }."); } NativePlayer.SetStreamingBufferingTime(Handle, value.PreBufferMillisecond, value.ReBufferMillisecond).