Instead of comparing the current time to the duration, the playback manager now has an explicit Ended state that jumps to the duration. The element simply reacts to that to trigger the ended event and attribute, along with all the other steps involved. This moves the ended event to fire after the seeked event, which matches other browsers' behavior. The spec doesn't explicitly say which order they should fire in.
28 lines
784 B
C++
28 lines
784 B
C++
/*
|
|
* Copyright (c) 2025-present, the Ladybird developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibMedia/PlaybackStates/PlaybackStateHandler.h>
|
|
|
|
#define ENUMERATE_PLAYBACK_STATE_HANDLERS(X) \
|
|
X(StartingStateHandler) \
|
|
X(BufferingStateHandler) \
|
|
X(PlaybackStateHandler) \
|
|
X(PlayingStateHandler) \
|
|
X(PausedStateHandler) \
|
|
X(ResumingStateHandler) \
|
|
X(SeekingStateHandler) \
|
|
X(EndedStateHandler)
|
|
|
|
namespace Media {
|
|
|
|
#define __ENUMERATE_PLAYBACK_STATE_HANDLER(type) \
|
|
class type;
|
|
ENUMERATE_PLAYBACK_STATE_HANDLERS(__ENUMERATE_PLAYBACK_STATE_HANDLER)
|
|
#undef __ENUMERATE_PLAYBACK_STATE_HANDLER
|
|
|
|
}
|