Freigeben über


MediaRecorder.SetOrientationHint(Int32) Method

Definition

Sets the orientation hint for output video playback.

[Android.Runtime.Register("setOrientationHint", "(I)V", "GetSetOrientationHint_IHandler")]
public virtual void SetOrientationHint (int degrees);
[<Android.Runtime.Register("setOrientationHint", "(I)V", "GetSetOrientationHint_IHandler")>]
abstract member SetOrientationHint : int -> unit
override this.SetOrientationHint : int -> unit

Parameters

degrees
Int32

the angle to be rotated clockwise in degrees. The supported angles are 0, 90, 180, and 270 degrees.

Attributes

Exceptions

if the angle is not supported.

Remarks

Sets the orientation hint for output video playback. This method should be called before prepare(). This method will not trigger the source video frame to rotate during video recording, but to add a composition matrix containing the rotation angle in the output video if the output format is OutputFormat.THREE_GPP or OutputFormat.MPEG_4 so that a video player can choose the proper orientation for playback. Note that some video players may choose to ignore the compostion matrix in a video during playback.

Java documentation for android.media.MediaRecorder.setOrientationHint(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to