Clock management with the Video Player component
Control the timing of your video playback relative to other interactive behaviors.
Read time 2 minutesLast updated 13 days ago
This section describes the different time update modes available for the Video Player component and how it interacts with them.
You can use the Video Player component to control how to time video playback relative to other interactive behaviors. For example, you can synchronize video playback with animation or with audio. You can do this through the following time update modes:
- Audio Digital Signal Processing (DSP) clock
- Game time
- Unscaled game time
The Video Player follows Unity's capture frame rate () and capture delta time ().
Time.captureFramerateTime.captureDeltaTimeCapture frame rate
If you set capture frame rate to a value above 0, the Video Player's playback becomes synchronous. The Video Player displays all frames at the expected time stamp even if it needs to delay the entire game's execution.
With a non-zero capture frame rate, Video Player operations - including preparation and seek - run synchronously to ensure consistent results. However, this might slow down game execution especially when the video must remain synchronized with the rest of the scene. For example, the Unity Recorder uses this special behavior of time to produce smooth recordings.
The capture frame rate only affects the Video Player when you set Video Player's Time Update Mode () to Game Time ().
timeUpdateModeVideoTimeUpdateMode.GameTimeIf you set Time Update Mode to a different value, the Video Player ignores capture frame rate and runs asynchronously. The Video Player might skip or repeat frames to stay in sync, and it performs preparation and seek operations asynchronously so playback isn't blocked.
Audio DSP clock
The audio DSP clock comes from the Audio module. You can access it through .
AudioSettings.dspTimeGame time
Game time is set in the Time module. You can access it using C# through . When you use game time, also known as scaled game time, Unity follows the Time Scale value set in the Time window. You can also modify the Time Scale value using C# through . However, if the capture frame rate or capture delta time have non-zero values, game time changes according to the rules that govern the time manager's capture frame rate feature.
Time.timeTime.timeScaleNote: Capture delta time is the same as 1 divided by the capture frame rate. It's another view of the same information.
Unscaled game time
When you use Unscaled game time, the Video Player ignores the Time Scale value. Unscaled game time comes from the Time module. You can access it using C# through .
Time.unscaledTime