wry icon indicating copy to clipboard operation
wry copied to clipboard

PictureInPicture is not working

Open keiya01 opened this issue 3 years ago • 11 comments

Describe the bug PictureInPicture is not working on macos and linux too. Windows works fine.

Steps To Reproduce Steps to reproduce the behavior:

Setup webview with https://mdn.github.io/dom-examples/picture-in-picture/index.html .

let webview = WebViewBuilder::new(window)?.with_url("https://mdn.github.io/dom-examples/picture-in-picture/index.html")?;

Expected behavior A clear and concise description of what you expected to happen.

Open PictureInPicture

Screenshots If applicable, add screenshots to help explain your problem.

Platform and Versions (please complete the following information): OS: Rustc:

Would you assign yourself to resolve this bug?

  • [x] Yes
  • [ ] No

Additional context Add any other context about the problem here.

keiya01 avatar Jul 29 '22 14:07 keiya01

On macos, we can set allowsPictureInPictureMediaPlayback flag to wkwebview preference.

keiya01 avatar Jul 29 '22 14:07 keiya01

Oh I see. HTML5 video have not been working with custom protocol on linux yet... https://github.com/tauri-apps/tauri/issues/3725

keiya01 avatar Jul 30 '22 03:07 keiya01

In webkitgtk PiP is still not implemented... https://bugs.webkit.org/show_bug.cgi?id=202756

keiya01 avatar Jul 30 '22 13:07 keiya01

why would you want PIP in a desktop app? seems to me like it is a feature for a browser and not for a desktop app. Users could always implement a diy PIP player using an undecorated window.

amrbashir avatar Jul 31 '22 11:07 amrbashir

seems like PIP is already enabled for macOS according to https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614792-allowspictureinpicturemediaplayb?language=objc:

The default value of this property is YES.

amrbashir avatar Jul 31 '22 12:07 amrbashir

seems like PIP is already enabled for macOS according to https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614792-allowspictureinpicturemediaplayb?language=objc:

The default value of this property is YES.

In my macos, this was not working...

keiya01 avatar Aug 01 '22 00:08 keiya01

why would you want PIP in a desktop app? seems to me like it is a feature for a browser and not for a desktop app. Users could always implement a diy PIP player using an undecorated window.

hmm I see. But I think PiP is useful for implementing simply.

keiya01 avatar Aug 01 '22 01:08 keiya01

If i understand that doc page correctly this api seems to not be implemented on macos? It only mentions mac catalyst which is the platform that allows running ipad apps on mac.

but we're talking about apple docs so that could mean anything really...

FabianLars avatar Aug 01 '22 09:08 FabianLars

I understood! Thank you @FabianLars 🙏 That is, to enable PiP feature on Apple devices, it seems that we need to invoke allowsPictureInPictureMediaPlayback for mobile and do this PR for desktop. edit: but on mobile this feature is enabled by default.

keiya01 avatar Aug 01 '22 11:08 keiya01

@wusyong What do you think about @amrbashir's comment https://github.com/tauri-apps/wry/issues/644#issuecomment-1200410398 ?

keiya01 avatar Aug 02 '22 14:08 keiya01

If this is one year ago me, I'll also agree on unnecessary feature. But since project keeps growing, I understand there will be more demands. This feature doesn't affect that much, and it's simply just one command on mac. I think it's good to have.

wusyong avatar Aug 03 '22 05:08 wusyong