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.
19 lines
442 B
C++
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);
|
|
}
|
|
|
|
}
|