Subject of the issue
The _media._loop configuration option has no effect; videos do not loop when it is enabled.
Your environment
- Framework 5.56.2
- adapt-youtube v3.3.2
- Chrome (latest), macOS
Steps to reproduce
- Add a YouTube component and set
_media._loop to true.
- Play the video to the end.
Expected behaviour
The video restarts and plays again (loops).
Actual behaviour
The video stops at the end and does not loop.
There are two underlying causes:
- The template reads
_loop at the root of the component config, but the option is defined at _media._loop in the schema, so the condition never matches.
- Even with the correct path, the YouTube IFrame API requires
playlist=<videoId> alongside loop=1 to loop a single video, and because the component instantiates a YT.Player on the existing iframe, the API rewrites the iframe src and drops the playlist value. A blank playlist= also causes a "Video unavailable" error.
Suggested Fix
Handle looping through the player API instead of URL parameters: on the ENDED state, if _media._loop is enabled, call seekTo(0) and playVideo(). Remove the &loop= URL parameter, since URL-based looping suppresses the ENDED event the handler relies on.
Posted via collaboration with Claude Code
Subject of the issue
The
_media._loopconfiguration option has no effect; videos do not loop when it is enabled.Your environment
Steps to reproduce
_media._looptotrue.Expected behaviour
The video restarts and plays again (loops).
Actual behaviour
The video stops at the end and does not loop.
There are two underlying causes:
_loopat the root of the component config, but the option is defined at_media._loopin the schema, so the condition never matches.playlist=<videoId>alongsideloop=1to loop a single video, and because the component instantiates aYT.Playeron the existing iframe, the API rewrites the iframesrcand drops theplaylistvalue. A blankplaylist=also causes a "Video unavailable" error.Suggested Fix
Handle looping through the player API instead of URL parameters: on the
ENDEDstate, if_media._loopis enabled, callseekTo(0)andplayVideo(). Remove the&loop=URL parameter, since URL-based looping suppresses theENDEDevent the handler relies on.Posted via collaboration with Claude Code