mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:57:35 +00:00
VideoPlayer/LibVideo: Implement the UI functionality for seeking
With these changes, the seek bar can be used, but only to seek to the start of the file. Seeking to anywhere else in the file will cause an error in the demuxer. The timestamp label that was previously invisible now has its text set according to either the playback or seek slider's position.
This commit is contained in:
parent
e216d1a65f
commit
f31621b3f2
7 changed files with 84 additions and 13 deletions
|
@ -53,9 +53,9 @@ DecoderErrorOr<MatroskaDemuxer::TrackStatus*> MatroskaDemuxer::get_track_status(
|
|||
return &m_track_statuses.get(track).release_value();
|
||||
}
|
||||
|
||||
DecoderErrorOr<void> MatroskaDemuxer::seek_to_most_recent_keyframe(Track track, size_t timestamp)
|
||||
DecoderErrorOr<void> MatroskaDemuxer::seek_to_most_recent_keyframe(Track track, Time timestamp)
|
||||
{
|
||||
if (timestamp == 0) {
|
||||
if (timestamp.is_zero()) {
|
||||
// Removing the track status will cause us to start from the beginning.
|
||||
m_track_statuses.remove(track);
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue