Conversation
Add a repeat attribute to the playlist block that controls whether the playlist loops back to the first track after the last track ends. Previously, the editor always looped while the frontend always stopped, creating inconsistent behavior. Now both respect the repeat setting: - When repeat is off (default): playback stops after the last track - When repeat is on: playback loops back to the first track The toggle is available in the block's Settings panel in the inspector. This addresses a review comment from @tyxla on PR #75203: #75203 (comment) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Size Change: +66 B (0%) Total Size: 6.87 MB
ℹ️ View Unchanged
|
tyxla
left a comment
There was a problem hiding this comment.
Thanks for working on it, but actually, this isn't what I meant.
My expectation was that the "repeat" toggle would rather be a new control in the player itself, allowing the end user to toggle repeat on or off.
As for the block setting, I don't even think we'll need one, we could just default to "off" for now.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Ah ok, I'll do that in a different PR where I add all the buttons... |
Summary
Add a
repeatattribute to the playlist block that controls whether the playlist loops back to the first track after the last track ends.This addresses a review comment from @tyxla on #75203:
#75203 (comment)
Problem
Previously, the playlist block had inconsistent end-of-playlist behavior:
edit.js): Always looped back to the first trackview.js): Stopped after the last track (no looping)Changes
repeatboolean attribute (default:false) toblock.jsonedit.jsto respect therepeatattribute in theonTrackEndedcallbackindex.phpto pass therepeatattribute to the frontend viadata-wp-contextview.jsto respect therepeatcontext value in theonEndedcallbackBehavior
Test plan
🤖 Generated with Claude Code