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: i32Defines how the video content will be stretched to fill the target area.
m_AudioOutputMode: i32Destination for the audio embedded in the video.
m_ControlledAudioTrackCount: u16Number of audio tracks that this VideoPlayer will take control of.
m_DataSource: i32§m_DirectAudioMutes: Vec<bool>§m_DirectAudioVolumes: Vec<f32>§m_Enabled: u8Enabled Behaviours are Updated, disabled Behaviours are not.
m_EnabledAudioTracks: Vec<bool>§m_FrameReadyEventEnabled: bool§m_GameObject: PPtrThe 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: boolWhether the content will start playing back as soon as the component awakes.
m_PlaybackSpeed: f32Factor by which the basic playback rate will be multiplied.
m_RenderMode: i32Where the video content will be drawn.
m_SkipOnDrop: boolWhether 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: PPtrCamera 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: f32Overall transparency level of the target camera plane video.
m_TargetMaterialProperty: StringMaterial texture property which is targeted when VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride.
m_TargetMaterialRenderer: PPtrRenderer which is targeted when VideoPlayer.renderMode is set to Video.VideoTarget.MaterialOverride
PPtr<Renderer>: (5.6.0b1 - 2022.3.2f1)
m_TargetTexture: PPtrRenderTexture to draw to when VideoPlayer.renderMode is set to Video.VideoTarget.RenderTexture.
PPtr<RenderTexture>: (5.6.0b1 - 2022.3.2f1)
m_Url: StringThe file or HTTP URL that the VideoPlayer reads content from.
m_VideoClip: PPtrPPtr<VideoClip>: (5.6.0b1 - 2022.3.2f1)
m_WaitForFirstFrame: boolDetermines 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)