action at video end

Q&A about the latest versions
Post Reply
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

I have an intro video auto-play and when it ends (deactivates) I run a number of actions including hiding the video and going to the first pano node. But the default video controls "pause" and "full-screen" cause deactivation. So I removed the actions on the video with the deactivation source trigger and added them to a "skip intro" button. That's ok, but now if I let the video run to the end, it just sits there... is there any way to run action steps when the video ends or stops?
User avatar
Hopki
Gnome
Posts: 13025
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
Add a, deactivate, trigger click, skip intro button.
That should do it.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

But then hitting pause or full screen on the controls will cause the deactivate and run the trigger click.
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

The default player controls have a time counter/full time indicator. Might there be some way in javascript to trigger an action when the time counter reaches/equals the full time (meaning it has reached the end of the video)?
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

This is a request going out to someone that has more javascript knowledge than I. I would think that there has to be some way to trigger an action when a video reaches the end of the file. My situation is that I am using the default player controls and clicking any of the controls causes a "deactivation" source event, which for my situation is bad. So I am trying to find a way recognize that the video has reached the end, and trigger an action. I figure that since the player knows the total video time and the current time, there has to be some sort of javascript method to do trigger an action once the current time = the total time.
christoph
Gnome
Posts: 108
Joined: Mon Aug 20, 2012 3:01 pm

Hi!
We talked about that and decided to introduce a new action source 'media ended', which you can use on videos and seekbars, and only fires when the video (or sound or whatever) is ended - not when it is paused.
This will be included in a future release....

Regards,
Christoph
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

Cool. That will be useful for popup videos within a node.

For my intro video, I ended up creating a new tour (with one node), with the intro video at the top of the skin (auto play, controls, 0,0, 100%, 100%). Then to cause an automatic redirect at the end of the video, I added the following code to the generated output index file (with "http://url_to_redirect_to" being the url to my main tour). Works great:


// *****this is already in the generated file*****
<script type="text/javascript">

// create the panorama player with the container
pano=new pano2vrPlayer("container");
// add the skin object
skin=new pano2vrSkin(pano);
// load the configuration
window.addEventListener("load", function() {
pano.readConfigUrlAsync("pano.xml");
});

// ***** this is what I added *****

var vid = document.getElementsByTagName('video')[0];
vid.addEventListener('ended', function() {
window.location.href = 'http://url_to_redirect_to';
});
// ***** end of what I added *****

</script>
kconklin
Posts: 32
Joined: Thu May 25, 2017 11:58 am

Forgot to mention, I was going down the route of just creating a simple html page with a videoJS player in it with the redirect, but struggled so much with making the video be responsive both ways that I decided to just leverage what you have with Pano2VR since you seem to have that working great on your side. Plus it was just easier to add "skip intro" links in pano.
JSchrader
Posts: 141
Joined: Sat Nov 28, 2015 2:26 pm

Yes, please. It's badly needed.
christoph wrote: Wed Apr 04, 2018 3:58 pm Hi!
We talked about that and decided to introduce a new action source 'media ended', which you can use on videos and seekbars, and only fires when the video (or sound or whatever) is ended - not when it is paused.
This will be included in a future release....

Regards,
Christoph
Post Reply