bfmatei / PiPTool

Add the Picture-in-Picture Functionality to YouTube, Netflix, Plex and other video broadcasting services in macOS Sierra
GNU General Public License v3.0
355 stars 34 forks source link

Selecting video on Vimeo page was having a hard time #19

Closed dbryand closed 7 years ago

dbryand commented 7 years ago

Cool extension. I would click it and the red bar would sometimes show and sometimes not. Was seeing some console errors:

image

In the end, I decided to go with a simple bookmarklet that works very nicely to simply take the playing video and put it in PIP and it works across all websites.

javascript: var video; document.querySelectorAll('video').forEach(function(vid) { if (!vid.paused) video = vid; }); if (video) { video.webkitSetPresentationMode('picture-in-picture') }
bfmatei commented 7 years ago

Hello,

  1. Vimeo already has a picture-in-picture functionality included in the default player.
  2. The "Can't find variable safari" issue is caused by Safari itself and you can just ignore that at the moment. It will be fixed in the upcoming version.
  3. The little snippet you pasted indeed works but only for the videos inserted directly in the current page. For the embedded clips via iframe (for example YouTube) it is not working.

I will leave this opened until next version so we can track the things that have changed.

Regards, Bogdan

PS: as a good practice, when using javascript code from bookmarks, wrap them in an IIF like so: javascript:(function(){/** Your code here */}());