Forum Discussion
BarbaraJacobs-1
1 year agoCommunity Member
Turn OFF Picture-in-Picture using JavaScript
We need to turn off picture-in-picture for videos. I found this online, but I need to know how to work this for Storyline videos (not iframes). Can this work in Storyline? How would I post the source... same as other internal assets, story_content/external_files/???
<video id="vid" controls muted>
<source src="https://www.w3schools.com/html/mov_bbb.mp4">
</video>
<script>
vid=document.getElementById("vid")
vid.disablePictureInPicture = true
</script>
or
const videoElement = document.querySelector('video');
videoElement.disablePictureInPicture = true;
19 Replies
- NedimCommunity Member
Try:
const videoPip = document.querySelector('.video-pip');
videoPip.style.display = 'none'
Run with Execute JS when the timeline starts on this slide- RussLickteigCommunity Member
Hi Nedim! Thank you so much for the JS code to turn off PiP! Any chance you can share the same to turn off Full Screen?
- RussLickteigCommunity Member
Figured it out!
const videoFullscreen = document.querySelector('.video-full-screen');
videoFullscreen.style.display = 'none'
Related Content
- 3 months ago