Fullscreen or .mejs__unfullscreen button

bmazy6337
bmazy6337 Community Member Posts: 35 ♪ Opening Act ♪
edited November 28, 2022 in Lectora Desktop

Ok, so I got another crazy question for you guys!!!

You guys are amazing!!!! :)


Ok here goes!

So, a student can view the course and can view videos full screen! Works great! However, I wanted to have content pop up over the video and the video pause, some fun interaction!! This all works great, and the logic is there.. Unless the user or student is viewing the video fullscreen! At that point the video pauses and you hear sounds, but you can't see the content.

This would simulate the checkbox (Always on top) if it were checked. But it's not... I've concluded that if the video is fullscreen nothing can populate on top!

So... would there be a way to simulate or code (javascript maybe) that would act as if this button were clicked .. .mejs__unfullscreen button

I'm thinking something like this

function clickButton() {

      document.querySelector('.mejs__unfullscreen button').click();

    }


If so I think that would take the user out of fullscreen and at that point i could use the Sync Events to implement this :)


I hope that makes sense!! Thanks in advance!!!


Hope you all had a great turkey day!!! :)

Brandon

Comments

  • timk
    timk Community Member Posts: 1,244 ✭ Legend ✭

    Haven't you tested your code?

    For me it works as long as the video is in fullscreen mode. If not it will throw an error.

    Try:

    triv$('.mejs__unfullscreen button').click();

    This worked in my test.

  • bmazy6337
    bmazy6337 Community Member Posts: 35 ♪ Opening Act ♪

    I tried mine :(


    But YOURS worked!!!!!! :)


    Thank you so much! You Rock Tim!!! @timk

  • bmazy6337
    bmazy6337 Community Member Posts: 35 ♪ Opening Act ♪

    I stand corrected! @timk Your code worked great in authoring mode. But when viewing it on the LMS as SCORM. It, unfortunately, did not simulate the button being clicked.

    But so close!!

  • bmazy6337
    bmazy6337 Community Member Posts: 35 ♪ Opening Act ♪

    Investing it works in Lectora and in a browser from Lectora, but... from the research I've done some items might have issues when uploaded to a LMS in and housed in a Iframe......

  • timk
    timk Community Member Posts: 1,244 ✭ Legend ✭

    Do you publish with Seamless Play?

    Try:

    triv$(getDisplayDocument()).find('.mejs__unfullscreen button').click();

    This should work both ways. There are other way to finish the fullscreen mode, e.g.

    getDisplayDocument().exitFullscreen();

    This should work without relying on the button.

  • bmazy6337
    bmazy6337 Community Member Posts: 35 ♪ Opening Act ♪

    Thank you sir!!! I will give that a try tonight!!!

    I so appreciate your help!!!!

    If you ever need anything image-related let me know!!

  • bmazy6337
    bmazy6337 Community Member Posts: 35 ♪ Opening Act ♪

    @timk my friend you are a valuable resource!!

    Yes sir it worked!!! I tested in on the LMS and in chrome and 100% success!!!


    Thank you so much!!!