PictureInPicture is not working
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.
On macos, we can set allowsPictureInPictureMediaPlayback flag to wkwebview preference.
Oh I see. HTML5 video have not been working with custom protocol on linux yet... https://github.com/tauri-apps/tauri/issues/3725
In webkitgtk PiP is still not implemented... https://bugs.webkit.org/show_bug.cgi?id=202756
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.
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.
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...
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.
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...
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.
@wusyong What do you think about @amrbashir's comment https://github.com/tauri-apps/wry/issues/644#issuecomment-1200410398 ?
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.