action at video end
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?
- Hopki
- Gnome
- Posts: 13027
- 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
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/
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/
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.
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
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
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>
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>
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.
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