public final class VideoSize


Represents the video size.

Summary

Constants

static final VideoSize

Public fields

final @IntRange(from = 0) int

The video height in pixels, 0 when unknown.

final @FloatRange(from = 0, fromInclusive = false) float

The width to height ratio of each pixel, 1 if unknown.

final @IntRange(from = 0, to = 359) int

This field is deprecated.

Rotation is handled internally by the player, so this is always zero.

final @IntRange(from = 0) int

The video width in pixels, 0 when unknown.

Public constructors

@UnstableApi
VideoSize(@IntRange(from = 0) int width, @IntRange(from = 0) int height)

Creates a VideoSize without unapplied rotation or anamorphic content.

@UnstableApi
VideoSize(
    @IntRange(from = 0) int width,
    @IntRange(from = 0) int height,
    @FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio
)

Creates a new instance.

@UnstableApi
VideoSize(
    @IntRange(from = 0) int width,
    @IntRange(from = 0) int height,
    @IntRange(from = 0, to = 359) int unappliedRotationDegrees,
    @FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio
)

This method is deprecated.

Use VideoSize instead.

Public methods

boolean
static VideoSize

Restores a VideoSize from a Bundle.

int
Bundle

Constants

UNKNOWN

public static final VideoSize UNKNOWN

Public fields

height

public final @IntRange(from = 0) int height

The video height in pixels, 0 when unknown.

pixelWidthHeightRatio

public final @FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio

The width to height ratio of each pixel, 1 if unknown.

For the normal case of square pixels this will be equal to 1.0. Different values are indicative of anamorphic content.

unappliedRotationDegrees

public final @IntRange(from = 0, to = 359) int unappliedRotationDegrees

width

public final @IntRange(from = 0) int width

The video width in pixels, 0 when unknown.

Public constructors

VideoSize

@UnstableApi
public VideoSize(@IntRange(from = 0) int width, @IntRange(from = 0) int height)

Creates a VideoSize without unapplied rotation or anamorphic content.

Parameters
@IntRange(from = 0) int width

The video width in pixels.

@IntRange(from = 0) int height

The video height in pixels.

VideoSize

@UnstableApi
public VideoSize(
    @IntRange(from = 0) int width,
    @IntRange(from = 0) int height,
    @FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio
)

Creates a new instance.

Parameters
@IntRange(from = 0) int width

The video width in pixels.

@IntRange(from = 0) int height

The video height in pixels.

@FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio

The width to height ratio of each pixel. For the normal case of square pixels this will be equal to 1.0. Different values are indicative of anamorphic content.

VideoSize

@UnstableApi
public VideoSize(
    @IntRange(from = 0) int width,
    @IntRange(from = 0) int height,
    @IntRange(from = 0, to = 359) int unappliedRotationDegrees,
    @FloatRange(from = 0, fromInclusive = false) float pixelWidthHeightRatio
)

Public methods

equals

public boolean equals(@Nullable Object obj)

fromBundle

@UnstableApi
public static VideoSize fromBundle(Bundle bundle)

Restores a VideoSize from a Bundle.

hashCode

public int hashCode()

toBundle

@UnstableApi
public Bundle toBundle()