VideoPlayer

Struct VideoPlayer 

Source
pub struct VideoPlayer {
Show 29 fields pub m_AspectRatio: i32, pub m_AudioOutputMode: i32, pub m_ControlledAudioTrackCount: u16, pub m_DataSource: i32, pub m_DirectAudioMutes: Vec<bool>, pub m_DirectAudioVolumes: Vec<f32>, pub m_Enabled: u8, pub m_EnabledAudioTracks: Vec<bool>, pub m_FrameReadyEventEnabled: bool, pub m_GameObject: PPtr, pub m_Looping: bool, pub m_PlayOnAwake: bool, pub m_PlaybackSpeed: f32, pub m_RenderMode: i32, pub m_SkipOnDrop: bool, pub m_TargetAudioSources: Vec<PPtr>, pub m_TargetCamera: PPtr, pub m_TargetCameraAlpha: f32, pub m_TargetMaterialProperty: String, pub m_TargetMaterialRenderer: PPtr, pub m_TargetTexture: PPtr, pub m_Url: String, pub m_VideoClip: PPtr, pub m_WaitForFirstFrame: bool, pub m_TargetCamera3DLayout: Option<i32>, pub m_TargetMaterialName: Option<String>, pub m_TimeReference: Option<i32>, pub m_TimeUpdateMode: Option<i32>, pub m_VideoShaders: Option<Vec<PPtr>>,
}
Expand description

VideoPlayer is a class of the Unity engine since version 5.6.0b1. Exert from Unity’s scripting documentation: Plays video content onto a target. Content can be either a VideoClip imported asset or a URL such as file:// or http://. Video content will be projected onto one of the supported targets, such as camera background or RenderTexture. If the video content includes transparency, this transparency will be present in the target, allowing objects behind the video target to be visible. When the data VideoPlayer.source is set to URL, the audio and video description of what is being played will only be initialized once the VideoPlayer preparation is completed. You can test this with VideoPlayer.isPrepared.The following demonstrates a few features of the VideoPlayer:

Fields§

§m_AspectRatio: i32

Defines how the video content will be stretched to fill the target area.

§m_AudioOutputMode: i32

Destination for the audio embedded in the video.

§m_ControlledAudioTrackCount: u16

Number of audio tracks that this VideoPlayer will take control of.

§m_DataSource: i32§m_DirectAudioMutes: Vec<bool>§m_DirectAudioVolumes: Vec<f32>§m_Enabled: u8

Enabled Behaviours are Updated, disabled Behaviours are not.

§m_EnabledAudioTracks: Vec<bool>§m_FrameReadyEventEnabled: bool§m_GameObject: PPtr

The game object this component is attached to. A component is always attached to a game object. PPtr<GameObject>: (5.6.0b1 - 2022.3.2f1)

§m_Looping: bool§m_PlayOnAwake: bool

Whether the content will start playing back as soon as the component awakes.

§m_PlaybackSpeed: f32

Factor by which the basic playback rate will be multiplied.

§m_RenderMode: i32

Where the video content will be drawn.

§m_SkipOnDrop: bool

Whether the VideoPlayer is allowed to skip frames to catch up with current time.

§m_TargetAudioSources: Vec<PPtr>

Vec<PPtr<AudioSource>>: (5.6.0b1 - 2022.3.2f1)

§m_TargetCamera: PPtr

Camera component to draw to when VideoPlayer.renderMode is set to either VideoRenderMode.CameraFarPlane or VideoRenderMode.CameraNearPlane. PPtr<Camera>: (5.6.0b1 - 2022.3.2f1)

§m_TargetCameraAlpha: f32

Overall transparency level of the target camera plane video.

§m_TargetMaterialProperty: String

Material texture property which is targeted when VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride.

§m_TargetMaterialRenderer: PPtr

Renderer which is targeted when VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride PPtr<Renderer>: (5.6.0b1 - 2022.3.2f1)

§m_TargetTexture: PPtr

RenderTexture to draw to when VideoPlayer.renderMode is set to Video.VideoTarget.RenderTexture. PPtr<RenderTexture>: (5.6.0b1 - 2022.3.2f1)

§m_Url: String

The file or HTTP URL that the VideoPlayer reads content from.

§m_VideoClip: PPtr

PPtr<VideoClip>: (5.6.0b1 - 2022.3.2f1)

§m_WaitForFirstFrame: bool

Determines whether the VideoPlayer will wait for the first frame to be loaded into the texture before starting playback when VideoPlayer.playOnAwake is on.

§m_TargetCamera3DLayout: Option<i32>

Type of 3D content contained in the source video media. i32: (2017.3.0b1 - 2022.3.2f1)

§m_TargetMaterialName: Option<String>

String: (5.6.0b1 - 5.6.0b10)

§m_TimeReference: Option<i32>

The clock that the VideoPlayer observes to detect and correct drift. i32: (2017.1.0b2 - 2022.3.2f1)

§m_TimeUpdateMode: Option<i32>

The clock source used by the VideoPlayer to derive its current time. i32: (2022.2.0b1 - 2022.3.2f1)

§m_VideoShaders: Option<Vec<PPtr>>

Vec<PPtr<Shader>>: (2020.1.0b1 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for VideoPlayer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for VideoPlayer

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for VideoPlayer

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,