/// <summary> /// Gets the level of the zoom of spherical video. /// </summary> /// <returns>The current zoom level of spherical video.</returns> /// <feature>http://tizen.org/feature/opengles.version.2_0</feature> /// <feature>http://tizen.org/feature/multimedia.player.spherical_video</feature> /// <exception cref="NotSupportedException">The required feature is not supported.</exception> /// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception> /// <seealso cref="SetZoom(float)"/> /// <since_tizen> 5 </since_tizen> public float GetZoom() { ValidationUtil.ValidateFeatureSupported(PlayerFeatures.OpenGl); ValidationUtil.ValidateFeatureSupported(PlayerFeatures.SphericalVideo); Player.ValidateNotDisposed(); NativePlayer.GetZoom(Player.Handle, out var value). ThrowIfFailed(Player, "Failed to get the level of the zoom"); return(value); }
/// <summary> /// Sets the maximum limit of the streaming variant. /// </summary> /// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception> /// <exception cref="ArgumentOutOfRangeException"> /// <pramref name="bandwidth"/> is less than -1.<br/> /// -or-<br/> /// <pramref name="width"/> is less than -1.<br/> /// -or-<br/> /// <pramref name="height"/> is less than -1.<br/> /// </exception> /// <seealso cref="GetMaxLimit()"/> /// <since_tizen> 5 </since_tizen> public void SetMaxLimit(int bandwidth, int width = -1, int height = -1) { Player.ValidateNotDisposed(); if (bandwidth < -1 || width < -1 || height < -1) { throw new ArgumentOutOfRangeException("invalid range"); } NativePlayer.SetMaxLimit(Player.Handle, bandwidth, width, height). ThrowIfFailed(Player, "Failed to set the max limit to the player"); }
/// <summary> /// Gets the number of tracks. /// </summary> /// <returns>The number of tracks.</returns> /// <remarks> /// The <see cref="Player"/> that owns this instance must be in the <see cref="PlayerState.Ready"/>, /// <see cref="PlayerState.Playing"/>, or <see cref="PlayerState.Paused"/> state. /// </remarks> /// <exception cref="ObjectDisposedException">The <see cref="Player"/> that this instance belongs to has been disposed of.</exception> /// <exception cref="NotAvailableException">The <see cref="Player"/> that this instance belongs to is not in the valid state. /// -or-<br/> /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0) /// </exception> /// <since_tizen> 3 </since_tizen> public int GetCount() { _owner.ValidateNotDisposed(); _owner.AudioOffload.CheckDisabled(); _owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); NativePlayer.GetTrackCount(_owner.Handle, _streamType, out var count). ThrowIfFailed(_owner, "Failed to get count of the track"); Log.Info(PlayerLog.Tag, "get count : " + count); return(count); }
/// <summary> /// Clears the equalizer effect. /// </summary> /// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception> /// <since_tizen> 3 </since_tizen> public void Clear() { Player.ValidateNotDisposed(); Native.EqualizerClear(Player.Handle). ThrowIfFailed("Failed to clear equalizer effect"); }
/// <summary> /// Sets the zoom with the field of view for spherical video. /// </summary> /// <param name="level">The zoom level.</param> /// <param name="fieldOfView">The degree values to display.</param> /// <feature>http://tizen.org/feature/opengles.version.2_0</feature> /// <feature>http://tizen.org/feature/multimedia.player.spherical_video</feature> /// <exception cref="NotSupportedException">The required feature is not supported.</exception> /// <exception cref="ObjectDisposedException"> /// The <see cref="Multimedia.Player"/> that this instance belongs to has been disposed of. /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// <pramref name="level"/> is less than 1.0. /// -or-<br/> /// <paramref name="level"/> is greater than 10.0.<br/> /// -or-<br/> /// <pramref name="fieldOfView.HorizontalDegrees"/> is less than 1.<br/> /// -or-<br/> /// <pramref name="fieldOfView.HorizontalDegrees"/> is greater than 360.<br/> /// -or-<br/> /// <pramref name="fieldOfView.VerticalDegrees"/> is less than 1.<br/> /// -or-<br/> /// <pramref name="fieldOfView.VerticalDegrees"/> is greater than 180.<br/> /// </exception> /// <seealso cref="FieldOfView"/> /// <seealso cref="GetZoom()"/> /// <since_tizen> 5 </since_tizen> public void SetZoomWithFieldOfView(float level, FieldOfView fieldOfView) { ValidationUtil.ValidateFeatureSupported(PlayerFeatures.OpenGl); ValidationUtil.ValidateFeatureSupported(PlayerFeatures.SphericalVideo); Player.ValidateNotDisposed(); if (level < 1.0F || 10.0F < level) { throw new ArgumentOutOfRangeException(nameof(level), level, "Valid level is 1.0 to 10.0"); } if (fieldOfView.HorizontalDegrees < 1 || fieldOfView.HorizontalDegrees > 360) { throw new ArgumentOutOfRangeException(nameof(fieldOfView.HorizontalDegrees), fieldOfView.HorizontalDegrees, $"Valid range is 1-360 degrees. : " + fieldOfView.HorizontalDegrees); } if (fieldOfView.VerticalDegrees < 1 || fieldOfView.VerticalDegrees > 180) { throw new ArgumentOutOfRangeException(nameof(fieldOfView.VerticalDegrees), fieldOfView.VerticalDegrees, $"Valid range is 1-180 degrees. : " + fieldOfView.VerticalDegrees); } NativePlayer.SetZoomWithFieldOfView(Player.Handle, level, fieldOfView.HorizontalDegrees, fieldOfView.VerticalDegrees). ThrowIfFailed(Player, "Failed to set the zoom with the field of the view."); }
/// <summary> /// Clears the equalizer effect. /// </summary> /// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception> /// <exception cref="InvalidOperationException"> /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0) /// </exception> /// <since_tizen> 3 </since_tizen> public void Clear() { Player.ValidateNotDisposed(); Player.AudioOffload.CheckDisabled(); Native.EqualizerClear(Player.Handle). ThrowIfFailed(Player, "Failed to clear equalizer effect"); }
/// <summary> /// Gets the field of view for spherical video. /// </summary> /// <returns>The <see cref="FieldOfView"/> containing the degree information to display.</returns> /// <feature>http://tizen.org/feature/opengles.version.2_0</feature> /// <feature>http://tizen.org/feature/multimedia.player.spherical_video</feature> /// <exception cref="NotSupportedException">The required feature is not supported.</exception> /// <exception cref="ObjectDisposedException"> /// The <see cref="Multimedia.Player"/> that this instance belongs to has been disposed of. /// </exception> /// <since_tizen> 5 </since_tizen> public FieldOfView GetFieldOfView() { ValidationUtil.ValidateFeatureSupported(PlayerFeatures.OpenGl); ValidationUtil.ValidateFeatureSupported(PlayerFeatures.SphericalVideo); Player.ValidateNotDisposed(); NativePlayer.GetFieldOfView(Player.Handle, out var horizontalDegrees, out var verticalDegrees). ThrowIfFailed(Player, "Failed to get the field of view"); return(new FieldOfView(horizontalDegrees, verticalDegrees)); }
/// <summary> /// Gets the direction of view for spherical video. /// </summary> /// <returns>The <see cref="DirectionOfView"/> containing the angle information.</returns> /// <feature>http://tizen.org/feature/opengles.version.2_0</feature> /// <feature>http://tizen.org/feature/multimedia.player.spherical_video</feature> /// <exception cref="NotSupportedException">The required feature is not supported.</exception> /// <exception cref="ObjectDisposedException"> /// The <see cref="Multimedia.Player"/> that this instance belongs to has been disposed of. /// </exception> /// <since_tizen> 5 </since_tizen> public DirectionOfView GetDirectionOfView() { ValidationUtil.ValidateFeatureSupported(PlayerFeatures.OpenGl); ValidationUtil.ValidateFeatureSupported(PlayerFeatures.SphericalVideo); Player.ValidateNotDisposed(); NativePlayer.GetDirectionOfView(Player.Handle, out var yaw, out var pitch). ThrowIfFailed(Player, "Failed to get the direction of view"); return(new DirectionOfView(yaw, pitch)); }
/// <summary> /// Clears the equalizer effect. /// </summary> /// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception> /// <exception cref="NotAvailableException">If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0) /// -or-<br/> /// <see cref="IsAvailable"/> returns false. (Since tizen 6.0) /// </exception> /// <seealso cref="IsAvailable"/> /// <since_tizen> 3 </since_tizen> public void Clear() { Player.ValidateNotDisposed(); Player.AudioOffload.CheckDisabled(); if (IsAvailable == false) { throw new NotAvailableException("The function is not available."); } Native.EqualizerClear(Player.Handle). ThrowIfFailed(Player, "Failed to clear equalizer effect"); }
/// <summary> /// Gets a <see cref="EqualizerBand"/> at the specified index. /// </summary> /// <param name="index">The index of the band to get.</param> /// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception> /// <exception cref="ArgumentOutOfRangeException"> /// <pramref name="index"/> is less than zero.<br/> /// -or-<br/> /// <paramref name="index"/> is equal to or greater than <see cref="Count"/>. /// </exception> /// <since_tizen> 3 </since_tizen> public EqualizerBand this[int index] { get { Player.ValidateNotDisposed(); if (index < 0 || Count <= index) { throw new ArgumentOutOfRangeException(nameof(index), index, $"Valid index is 0 <= x < { nameof(Count) } "); } if (_bands[index] == null) { _bands[index] = new EqualizerBand(this, index); } Log.Info(PlayerLog.Tag, "get equalizer band : " + _bands[index]); return(_bands[index]); } }
/// <summary> /// Sets the direction of view for spherical video. /// </summary> /// <param name="directionOfView">The angle values around the vertical and lateral axis.</param> /// <feature>http://tizen.org/feature/opengles.version.2_0</feature> /// <feature>http://tizen.org/feature/multimedia.player.spherical_video</feature> /// <exception cref="NotSupportedException">The required feature is not supported.</exception> /// <exception cref="ObjectDisposedException"> /// The <see cref="Multimedia.Player"/> that this instance belongs to has been disposed of. /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// <pramref name="directionOfView.Yaw"/> should be in range of [-3.141593, 3.141593].<br/> /// -or-<br/> /// <pramref name="directionOfView.Pitch"/> should be in range of [-1.570796, 1.570796].<br/> /// </exception> /// <seealso cref="DirectionOfView"/> /// <since_tizen> 5 </since_tizen> public void SetDirectionOfView(DirectionOfView directionOfView) { ValidationUtil.ValidateFeatureSupported(PlayerFeatures.OpenGl); ValidationUtil.ValidateFeatureSupported(PlayerFeatures.SphericalVideo); Player.ValidateNotDisposed(); if (directionOfView.Yaw > (float)Math.PI || directionOfView.Yaw < -(float)Math.PI) { throw new ArgumentOutOfRangeException(nameof(directionOfView.Yaw), directionOfView.Yaw, $"Valid values are in range [-PI, PI] : " + directionOfView.Yaw); } if (directionOfView.Pitch > (float)Math.PI / 2 || directionOfView.Pitch < -(float)Math.PI / 2) { throw new ArgumentOutOfRangeException(nameof(directionOfView.Pitch), directionOfView.Pitch, $"Valid values are in range [-PI/2, PI/2] : " + directionOfView.Pitch); } NativePlayer.SetDirectionOfView(Player.Handle, (float)directionOfView.Yaw, (float)directionOfView.Pitch). ThrowIfFailed(Player, "Failed to set the direction of the view."); }