Skip to content

Commit 970ce2b

Browse files
committed
Update VideoGravity.
1 parent 5463e15 commit 970ce2b

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed
Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,45 @@
11
package com.haishinkit.graphics
22

3+
import kotlinx.serialization.SerialName
4+
import kotlinx.serialization.Serializable
5+
36
/**
4-
* A value that specifies how the video is displayed within a layer’s bounds.
7+
* Specifies how a video is scaled or stretched to fit within its container bounds.
58
*/
69
@Suppress("UNUSED")
10+
@Serializable
711
enum class VideoGravity(
12+
/**
13+
* Platform-compatible integer representation of this gravity.
14+
*
15+
* This value is useful when bridging with native layers or
16+
* when a numeric representation is required.
17+
*/
818
val rawValue: Int,
919
) {
20+
/**
21+
* Stretches the video to fill the container bounds.
22+
*
23+
* The aspect ratio is not preserved.
24+
*/
25+
@SerialName("resize")
1026
RESIZE(0),
27+
28+
/**
29+
* Scales the video to fit within the container bounds
30+
* while preserving the original aspect ratio.
31+
*
32+
* Black bars may appear if the aspect ratios do not match.
33+
*/
34+
@SerialName("resizeAspect")
1135
RESIZE_ASPECT(1),
36+
37+
/**
38+
* Scales the video to completely fill the container bounds
39+
* while preserving the original aspect ratio.
40+
*
41+
* Portions of the video may be clipped if the aspect ratios do not match.
42+
*/
43+
@SerialName("resizeAspectFill")
1244
RESIZE_ASPECT_FILL(2),
1345
}

0 commit comments

Comments
 (0)