Skip to content

Instantly share code, notes, and snippets.

@dbryand
Last active January 13, 2017 02:49
Show Gist options
  • Save dbryand/242493d3dbb2d97980289c883965b48f to your computer and use it in GitHub Desktop.
Save dbryand/242493d3dbb2d97980289c883965b48f to your computer and use it in GitHub Desktop.
Bookmarklet for Safari to Picture-in-Picture the currently playing video
// Create a bookmark in safari with this as the address
javascript: (function() {var video; document.querySelectorAll('video').forEach(function(vid) { if (!vid.paused) video = vid; }); if (video) { video.webkitSetPresentationMode('picture-in-picture') } })()
@dbryand
Copy link
Author

dbryand commented Jan 13, 2017

Here is what it looks like when you go to bookmarks and create it:

image

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