Last year I wrote
popup-video.js, a Google-surveillance-defeating YouTube player. You may have noticed it in action on the
DNA Lounge calendar pages and
galleries but I've made some improvements recently.
- The web page contains only a locally-hosted thumbnail. Nothing from YouTube is loaded until someone clicks play. This means no surveillance trackers on every one of your pages that has a video, and also the pages load dozens fewer megabytes.
- When you click play, a fake-window pops up inside the page with a YouTube player.
- Clicking anywhere makes it go away.
- There's a "minimize" button that makes it drop back down into the place where the thumbnail was and continue playing.
- If the inline thumb is nearly as wide as the page, it plays inline instead of doing the popup thing (this is often the case on mobile).
- It works on playlists as well as single videos.
- For single videos, it generates an ad-hoc playlist of all of the other YouTube videos linked on the current page, so the "previous" and "next" buttons show those.
- It works on portrait videos and videos with weird aspect ratios.
Dear Lazyweb,
If you understand the ever-changing rules about auto-play, perhaps you can offer some guidance.
On desktop Safari, you have to click twice to get the first video to play: the YouTube player pops up but does not then auto-play, unless you have done "Website settings / Allow all auto-play" for jwz.org. This is -- what's the word -- fucked up, because the creation of the IFRAME and the sending of the "play" event all happen underneath the user's "click" event, so this should be considered interactive.
And on mobile Safari you always have to click twice.
(I don't remember what the situation is on Chrome or Firefox on account of not caring.)
Anyway, if you know how to make it play with one click instead of two, I would like to know how to do that. Your suggestion should take the form of, "Here's a modified version of your JS file that works". Your speculation is acknowledged and ignored.
Previously, previously, previously.