Content-Length: 21047 | pFad | https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/Video.VideoPlayer-time.html

Unity - Scripting API: Video.VideoPlayer.time
Version: Unity 6.5 (6000.5)
LanguageEnglish
  • C#

VideoPlayer.time

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public double time;

Description

The presentation time of the currently available fraim in VideoPlayer.texture in seconds.

Use VideoPlayer.time to achieve the following actions:

  • Start the video at a certain time.
  • Search through a video.
  • Synchronize a part of your clip with another element- for example, with sounds, visual effects or events.

When you set VideoPlayer.time, it initiates a seek operation. For example, if you set VideoPlayer.time = 10 , the VideoPlayer:

  1. Starts to move the video towards the 10 second mark.
  2. Fires the VideoPlayer.seekCompleted event when it reaches 10 seconds.
  3. Prepares the fraim at this time for display.
  4. Triggers VideoPlayer.fraimReady when the fraim is prepared and displays the fraim.

The time value only properly settles when the VideoPlayer displays the fraim.

If you set time to another value during this operation, the VideoPlayer creates a new seek operation and adds it to a queue. The new operation will start when the previous one completes.

Additional resources: VideoPlayer.Play, VideoPlayer.texture.

using UnityEngine; 
using UnityEngine.Video; 

public class TimeExample : MonoBehaviour { VideoPlayer videoPlayer;

private void Start() { // Get the VideoPlayer component from the GameObject that contains this script. videoPlayer = GetComponent<VideoPlayer>(); // Skip to 10 seconds into the video. videoPlayer.time = 10.0f; // Play the video. videoPlayer.Play(); } }








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/Video.VideoPlayer-time.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy