Explore the community Forums Lectora Lectora Questions & Answers Full-screen video via JavaScript Reply To: Full-screen video via JavaScript

#418132 Score: 0
Profile photo of Darrel Somoza
Darrel Somoza
friend finder
junior moderator
wise owl
curious george
209 pts

Hmm, not sure what is going on with your resizing issue. As long as the actual video file height and width match those in the web window html.index. <video> tag and the size of web window in Lectora there should be no issue. Just make sure the actual video is the size you want the web window in Lectora to be. Boy, that sounds confusing, I hope I explained it sufficiently.

As far as where to look to learn (which is highly commendable) go to mediaelementjs.com. You will find usage and the valuable API info top right (or just use these links).

If you are not used to calling Lectora actions from JavaScript it can be tricky, especially if you’re exporting your project with the troublesome ‘seamless play’ selected. I include the attached, not to do the work for you, but to provide additional material to assist in your learning. I always find examples of what I am trying to do extremely helpful. I left the progress bar in so that you can do what you don’t want your students to do, drag to right before the end of the video, so you can see the end of video action fire off without having to endure that animation one more time (the very last scene is bad enough to have to watch).

By the way, the Auto play property will work just fine once it’s uploaded to your server. It wont work locally. If you do a lot of custom work I strongly suggest you set up a local server, such as WAMP on your authoring computer so you can see exactly how your work will function on a real server. Okay, I’m going off on a tangent. Time to refocus.

You can call an action directly from JavaScript by calling the function action123() where 123 is the number of your action. You can fire off a group (one or more actions) by calling runGroup_og123() where 123 is the number of your group. If you are using ‘seamless play’ you will have to include parent (parent.runGroup_og123()) before the function call to properly target it (Good explanation why is explained elsewhere in the forum). I commented my code to show you where this goes.

In the sample I attached, because I was not attaching the action to anything, I added a group and put the action in the group. I could have called the action directly (action299 in my sample) however, I decided to call the group (og290 in my sample) instead. I could have placed any number of actions in that group. By the way, the Lectora awt is in the zip as well.

That’s about it. If you have a difficult time figuring out or finding instruction on the JavaScript (I didn’t put that many comments) let me know and I will write something up.

Good luck and I hope this helps.