An editor can load a video successfully and still fail to play it. If your UI flips to “playing” the moment play() is invoked, the controls can easily describe a playback state the browser never actually entered.
Wait for the playback outcome
HTMLMediaElement.play() returns a Promise. Handle both resolution and rejection cleanly, and always keep a clear, accessible way for the user to trigger playback manually. The MDN HTMLMediaElement.play() reference outlines the common reasons—such as autoplay policies or media constraints—why script-initiated playback may be rejected.
This gets trickier in a background remover video workflow where the original clip and the processed output live in separate media elements. Even if one preview starts playing without issue, that does not guarantee the companion element started too.
Make the button describe reality
Avoid optimistic UI updates that switch the button label to “Pause” or “Playing” without rolling back on failure.…