Blazorise
Blazorise copied to clipboard
Change video time
Is there a way of manually changing time of the current video playing?
I have the following code:
<div class="video-player">
<Video @ref="mainVideo" Source="@videoSource" DefaultQuality="1080" AutoPlay="true"
ClickToPlay="false" CurrentTime="@currentTime" TimeUpdate="HandleTimeUpdate" Ended="@OnVideoEnded"
SettingsList="new VideoSettingsType[]{VideoSettingsType.Captions, VideoSettingsType.Quality}"
ControlsList="new string[] { VideoControlsType.Mute, VideoControlsType.Volume, VideoControlsType.Settings,
VideoControlsType.Progress, VideoControlsType.CurrentTime,VideoControlsType.Captions }"
Seeking="HandleSeeking" Seeked="HandleSeeked"
Paused="@OnMainVideoPaused" Playing="@OnMainVideoPlaying"
/>
{
<div class="pip @(isPipEnabled ? "pip-front": "pip-back")">
<Video @ref="pipVideo" Source="@videoSource" DefaultQuality="1080" AutoPlay="true"
ClickToPlay="false" CurrentTime="@currentTime2"
TimeUpdate="@OnTimeUpdate2"
Controls="false"
SettingsList="new VideoSettingsType[] {}"
ControlsList="new string[] {}" />
</div>
}
</div>
I want to change the time of the second video player every time the user changes time in the first video player so that they are correctly synced. Any recommendations would be much appreciated :)
I believe I have posted an example of that on your last issue, can you check?
There's this example with jump to 20s https://bootstrapdemo.blazorise.com/tests/video https://github.com/Megabit/Blazorise/blob/master/Demos/Blazorise.Demo/Pages/Tests/VideoPage.razor
That is what CurrentTime
is used for.