ladybird/Libraries/LibMedia/PlaybackStates/PlaybackStateHandler.cpp
Zaggy1024 ccf4b3f6e9 LibMedia: Implement media seeking
This implementation allows:
- Accurate seeking to an exact timestamp
- Seeking to the keyframe before a timestamp
- Seeking to the keyframe after a timestamp
These three options will be used to satisfy the playback position
selection in the media element's seeking steps.
2025-10-27 17:28:49 -07:00

19 lines
442 B
C++

/*
* Copyright (c) 2025, Gregory Bertilson <zaggy1024@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibMedia/PlaybackManager.h>
#include <LibMedia/PlaybackStates/SeekingStateHandler.h>
#include "PlaybackStateHandler.h"
namespace Media {
void PlaybackStateHandler::seek(AK::Duration timestamp, SeekMode mode)
{
manager().replace_state_handler<SeekingStateHandler>(manager().is_playing(), timestamp, mode);
}
}