I'm working on integrating the Picture-In-Picture (PiP) feature into a custom HTML5 video player. With the introduction of PiP support in Safari 9 (announced at WWDC15), I aim to enhance the user experience on my website.
Here's the challenge: While Safari's default video controller includes a PiP button, I need to understand how to activate this feature programmatically using JavaScript for custom video controls.
During WWDC15, it was mentioned that:
"If you're using custom HTML5 video controls, you can integrate Picture-in-Picture functionality using the JavaScript Presentation Mode API."
However, specific instructions or documentation on implementing this were not provided.
What I need help with:
- How can I enable PiP in custom HTML5 video controls specifically for Safari?
- Are there any examples or documentation available that demonstrate the integration of PiP using the JavaScript Presentation Mode API in custom controls?
Any guidance or resources would be greatly appreciated!