Skip to content

Fix: Loop single videos via the player API (fixes #45)#46

Open
swashbuck wants to merge 1 commit into
masterfrom
issue/45
Open

Fix: Loop single videos via the player API (fixes #45)#46
swashbuck wants to merge 1 commit into
masterfrom
issue/45

Conversation

@swashbuck

@swashbuck swashbuck commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #45

Fix

  • Loop now works when _media._loop is enabled. On the ENDED player state, if looping is enabled the player seeks to the start and plays again.
  • Removed the &loop= URL parameter from the iframe src. It read the wrong config path (_loop instead of _media._loop) and, more importantly, URL-based looping suppresses the ENDED event the handler relies on. The single-video playlist= requirement is also avoided, which previously caused a blank playlist= and a "Video unavailable" error.

Testing

  1. Add a YouTube component, set _media._loop to true, point _media._source at any embeddable video (ex. //www.youtube.com/embed/jNQXAC9IVRw )
  2. Watch to the end. The video restarts and plays again.
  3. Confirm the iframe src no longer contains loop= or playlist=, and there is no "Video unavailable" error.
  4. With _media._loop set to false, the video stops at the end as before (and completes if _setCompletionOn is ended).

Note: _setCompletionOn: "ended" combined with _media._loop: true will never complete, as a looping video never reaches a final end. This is expected.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Fix _loop option does not loop the video

2 participants