Forum Discussion

BarbaraJacobs-1's avatar
BarbaraJacobs-1
Community Member
1 year 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;

19 Replies

  • Nedim's avatar
    Nedim
    Community Member

    Try:
    const videoPip = document.querySelector('.video-pip');
    videoPip.style.display = 'none'

    Run with Execute JS when the timeline starts on this slide

    • RussLickteig's avatar
      RussLickteig
      Community 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?  

      • RussLickteig's avatar
        RussLickteig
        Community Member

        Figured it out! 

        const videoFullscreen = document.querySelector('.video-full-screen');
        videoFullscreen.style.display = 'none'