Forum Discussion

BarbaraJacobs-1's avatar
BarbaraJacobs-1
Community Member
9 months ago

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;