Min: Support picture-in-picture mode

Created on 13 Jan 2020  路  6Comments  路  Source: minbrowser/min

Hello, dear developers!

I really like Min browser, it is awesome!

There is a function in yandex browser, wich allows you to watch video outside of the browser (in a separate window, that is above any other). It is really comfortable when you work and want to watch some video (for example, video-tutorial). I'll be really happy, if you add it.

Thanks for attention.
Nefedov Gleb

feature request

Most helpful comment

There's still some changes to make in Min to support this, so I'm going to leave this open until that's done.

All 6 comments

I'm glad you like it!

It looks like Electron already supports this - example: https://googlechrome.github.io/samples/picture-in-picture/, so it should be fairly straightforward to add an item to the context menu to enable this.

So, as it in development state, I close this thread, thaks you :-)

There's still some changes to make in Min to support this, so I'm going to leave this open until that's done.

I tried implementing this, and it works on a few sites (including Youtube), but is broken on a lot of others (Vimeo, Twitch, Reddit). The reason for this is that these sites all put an invisible <div> in front of the video element, so the context-menu event doesn't indicate that there's a video.

To solve this, we would have to search through the page to see if there's actually a video element at the mouse location (even if it isn't the top-most element). However, Electron doesn't support updating the menu after it's opened, so we would have to do this search before opening the menu, which would likely make it appear more slowly (on every page, not just ones with videos). I'm thinking this isn't worth it, but I'm not sure whether it's worth including this feature if it only works on a few sites.

Hi. I think it worth it.

I'm not sure whether it's worth including this feature if it only works on a few sites.

Because, if it doesn't bring any lags, it will be no problem, but might help some people (like me :-) (I watch videos only in youtube))

I tested the search-through-the-page approach, and the speed reduction turned out to be fairly minor, so I went ahead and implemented it in cee0aca0e3b7a83a4b8a41bd0e989cee146fd388. Testing on a few sites with videos:

  • Youtube works, but you have to right-click twice
  • Vimeo works
  • Dailymotion works
  • Twitch works
  • Reddit works
  • Imgur works
  • CNN doesn't work (because they set pointer-events: none on the video element)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

PEPERSO picture PEPERSO  路  4Comments

abejfehr picture abejfehr  路  6Comments

CherryMan picture CherryMan  路  3Comments

kohlrak picture kohlrak  路  6Comments

bjadel picture bjadel  路  5Comments