Forum Discussion
Turn OFF Picture-in-Picture using JavaScript
Good question! AsJürgen Schoenemeyer mentioned earlier in this thread, and I found to be the case, if video exceeds a certain duration, Firefox does not work. I use a combination of JavaScript, player controls (no expand) and screens to discourage users from attempting to expand and select PiP.
Can you share your solution? But do you think there is a method to disable at all? Or whe have to use some tricks or change video player at all?
Inviato da Outlook per iOS
- Jürgen_Schoene_6 months agoCommunity Member
just testet 'disablePictureInPicture' on Firefox
const videos = document.querySelectorAll('video');
videos.forEach(video => {
video.disablePictureInPicture = true;
});it's working, BUT only after the next slide change
https://360.articulate.com/review/content/0e393000-d4aa-47e5-a969-259921709110/review
screen recording
https://360.articulate.com/review/content/38f1c251-c338-43fc-b190-3b0afde6d5b2/review
on slide 2 and 3 there is NO JavasScript - only on slide 1
patch PiP:
- add the script on the start slide of the course
- result: PictureInPicture ist disabled in the complete course after leaving the start slide - also on slides with several videos at the same time
but:
- if you have enabled 'course resume', then this solution is not enough
- this cannot be tested on Review 360, because resume ist globally disabled
hint:
- for testing PiP on Firefox you need a webserver
- with 'file:// ...' PiP is always disabled - as far as I could test