MyAnythingList / YouTube Playlist Player Handoff
Version: 2026-05-01-v94
Primary file: index_beta_2026-05-01-v94.html
Package: index_beta_2026-05-01-v94.zip

User requirement:
- Do not debate whether embedded YouTube playlists are possible.
- This app is a YouTube playlist player where the authored page can provide its own initial thumbnail.
- Standard YouTube playlist interface must be accessible from the embedded player.
- Do not paste source code into chat. Return downloadable files only, preferably ZIP, because loose HTML may be rendered by the chat UI.

Observed failure from logs:
- v90 emitted an iframe URL in the form: /embed?listType=playlist&list=... with controls=0.
- That loads playlist context but strips native player controls, so the playlist interface cannot be accessed.

Ten issues addressed in v94:

1. Duplicate YouTube embed builders
Several independent code paths could construct iframe URLs. v94 adds a final canonical YouTube embed override so late click handlers, direct activation, and fallback creation all route through the same builder.

2. controls=0 reachable through older paths
Older paths could still suppress YouTube's native controls. v94 canonical output always uses controls=1 for YouTube iframe URLs.

3. Playlist embed endpoint did not preserve watch+playlist context reliably
The playlist-only form can lose the selected/start video from a normal watch URL. v94 uses /embed/VIDEO_ID?list=PLAYLIST_ID when the authored URL contains both v and list.

4. Playlist-only URLs need a distinct standard endpoint
Pure playlist URLs do not have a selected video id. v94 uses /embed/videoseries?list=PLAYLIST_ID for those URLs.

5. listType=playlist was unnecessary and inconsistent across paths
v94 removes listType from generated iframe URLs and uses YouTube's standard embed endpoints instead.

6. Overlay/chrome suppression was inconsistent
Some tile overlays could remain above or near the player while the iframe was active. v94 hides app chrome for active YouTube tiles and gives the iframe the full tile interaction area.

7. Pointer event conflicts
The app had multiple pointer/click layers. v94 forces the active iframe to accept pointer events and prevents the tile capture handler from stealing clicks that occur inside the iframe.

8. Duplicate iframe creation / iframe overwrite risk
Repeated click and recovery paths could remove or rebuild active iframes. v94 removes other YouTube iframes before activation and avoids recreating the active iframe when the existing src already matches the canonical URL.

9. origin parameter mismatch in local/file mode
A hardcoded or invalid origin can cause YouTube API/UI oddities in local contexts. v94 only emits origin when the app is running from an http or https origin.

10. Unused iframe API state
Earlier URLs enabled the JS API even though the required behavior is native playlist UI, not app-managed playlist control. v94 does not add enablejsapi in the canonical playlist embed URL.

Important implementation notes for next handoff:
- Keep the final v94 hotfix script near the end of the HTML, before </body>, so it wins over earlier definitions.
- Do not add custom playlist reconstruction, scraping, fake rails, or app-managed next/previous controls.
- Preserve native YouTube behavior.
- For watch+playlist: use /embed/VIDEO_ID?list=PLAYLIST_ID.
- For playlist-only: use /embed/videoseries?list=PLAYLIST_ID.
- Keep controls=1.
- Avoid returning loose HTML in chat. Provide ZIP only.

Static checks performed:
- No generated iframe path in v94 uses controls=0.
- The v94 canonical builder logs V94_FINAL_IFRAME_SRC for verification.
- The ZIP contains this handoff document and the HTML file.
