Message Boards Message Boards

Back

RE: pauze on mobile vertical

Toggle
pauze on mobile vertical
Answer
4/24/24 5:32 PM
Hi,

I'm having trouble understanding the 'onlayoutchange' function and think I'm just missing something emoticon
I'm making a lesson which will not be in a LMS but just on its own webpage. As it contains some video, I want to force people using it horizontally. So when it's vertical on mobile/ipad, I want to pauze the lessen/video and show a message "rotate your device for optimal use".

I can't find the created layouts as a node, only onlayoutchange. What I'm looking for is a master with:
onLayoutChange -> if: layout = mobile portrait -> show layer X
OnLayoutChange -> if: layout = default -> hide layer X

thanks in advance
ps, really love the new vimeo tool emoticon
0 (0 Votes)

RE: pauze on mobile vertical
Answer
4/24/24 6:02 PM as a reply to Marcel Ooms.
Hi Marcel,
Glad you like the Vimeo object! Also, great question - knowing which layout is shown is possible, but is sort of hidden.

First of all, to show something like a mask covering the screen, you don't technically need to know which layout is currently visible. You could simply move the objects you want onto the screen when viewing the Phone Portrait layout, and then in the Default layout, move them out of the way (off the screen).

However, to play/pause the video (or to truly SHOW or HIDE objects/layers using actions), you do need to know which layout is visible in the action area. You can use the trigger page.onLayoutChange and page.onLoad, and then in your condition, you ask the event parameter block, which is under the Variable category, and check that against your layout name. See the attached image.
0 (0 Votes)

RE: pauze on mobile vertical
Answer
4/25/24 9:14 AM as a reply to Navdeep Dhillon.
Hi,

This is perfect, I would have never found the 'phone portrait' as event parameter.
The only downside is that I now need to make a list with all the videos in it to use this function (pausing all videos) on a master on the entire course, but I guess this is doable with the 'set video id' block.

Thank you so much for your help emoticon
0 (0 Votes)

RE: pauze on mobile vertical
Answer
4/25/24 4:21 PM as a reply to Marcel Ooms.
Hi Marcel,
You could probably use tags to pause any video. And then, if you only have one video per page, you can tell any Vimeo object tagged to play when it's back in Default layout. Things get a little more complicated if you have multiple videos on the same page (a blanket pause command is fine, but to play you need to know WHICH video to play). Here's a sample action (see image).

Let me if that makes sense. If not, I can record a quick video.
0 (0 Votes)

RE: pauze on mobile vertical
Answer
4/29/24 12:36 PM as a reply to Navdeep Dhillon.
awesome, this is exactly what I was looking for!

I've got another small off topic question, but I can't get the hyperlinks to work in the new SB version on a object (on a smarttext it works fine). And also the popup/frame always opens a new tab on the parent (_new blanc), but that last thing might be because I'm not understanding completely how it works emoticon. I've read the SBmanual on hyperlinks, but it doens't really tell how the different options work

Thanks in advance for all your help and advice! emoticon 
0 (0 Votes)

RE: pauze on mobile vertical
Answer
4/29/24 5:21 PM as a reply to Marcel Ooms.
Hi Marcel,
What are you attaching the hyperlink to? Button, Hotspot, regular Text? See the attached image for the hyperlink settings, you might be doing it differently.

Also, where are you testing this? In Preview, links may be blocked, or always forced into a new window, so you might need to publish the lesson (and possibly host it) to get it to behave properly.

Lastly, what do you want it to do? Replace the current window? Create a popup?

If your situation is more complicated (dynamic link generated via actions?), maybe email us a copy of your lesson and let us know what page to look at (or create a simple case) and we can take a look. We'll post back here with our findings once we have a solution.
0 (0 Votes)