Page 1 of 1

[P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Fri Apr 23, 2021 10:44 am
by dennisvanduijn
Hi all!

I recently noticed that the Media Ended action on Youtube videos doesn't seem to work anymore. Please see the videos in this example project of mine:

https://www.okijk.nl/projecten/eriks/ede

The Media Ended action should trigger a click on the white close icon at the upper right, which hides the video pop-up and makes the GUI items to reappear. But instead, when the video ends, the video stays in view and Youtube video suggestions appear. Locally it works as expected, but online, it strangely is as described.

Settings are:
Autoplay: checked
Controls: checked
Loop: unchecked
Unload video on hide: checked

I checked several combination to see if this fixes it, but to no avail. Who could help me with this? Is this a bug, is there a workaround available?

Cheers!

Dennis

Re: [P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Fri Apr 23, 2021 11:22 am
by Hopki
Hi Dennis,
Just checked this and it's all working.
Please see the simple test attached.
Open the video and scrub to almost the and let it play.
On the media end, it hides the video.

Which YouTube video are you using, can you post the link?
I take it your using the video element and not a text box with embed code.
OK, just looked in the browser console, your using an iframe, you need to use the video element.
Regards,

Re: [P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Fri Apr 23, 2021 2:38 pm
by dennisvanduijn
Hi Hopki,

Thanks for your efforts. In fact, I am using the same video element, following the tip you gave me a while ago. I see that in your example, the youtube ID is given in the hotspot itself, and called for with $(hu). I do it differently, by an action at video button click that sets the value of the video element to be the Youtube video ID and also the variable VideoPlays to true. If true, then the container and the Video element are shown. Weird thing is, it does work with my project, but only locally. As soon as I upload and see the tour online (Windows Edge, FF, Chrome, cache cleaned), the faulty situation occors.

The video I am using is for eaxmple: https://youtu.be/F-Xa3v64wPM

Regards,

Dennis

Re: [P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Fri Apr 23, 2021 6:21 pm
by Hopki
Hi Dennis,
Just tried your way, so my project but with a button that sets a value to the video element, and then set the variable value.
Still working https://support.ggno.me/youtube3
Let me know when you have seen it so I can remove the project from my server.
The project that built it is attached.
Regards,

Re: [P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Mon Apr 26, 2021 8:49 pm
by dennisvanduijn
Hi Hopki,

Thank you very much for your help! Thanks to your examples, I saw I set up the skin elements just right. The cause was to be found somewhere else, so I tracked the issue down to the point that the index.html file appeared to be outdated. I am used to copy this file to each new project, so that I don't have to copy in the Google Analytics and the og: data anew every time. So, I replaced the index.html with the newly outputted one and that did the trick. The videos now just end as expected, and I know which bad habit I have to abandon :oops: .

Regards,

Dennis

Re: [P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Tue Apr 27, 2021 10:56 am
by k.ary.n
When you copy the HTML into the project, how are you doing this?

Maybe you could make your HTML file a template with the Analytics, etc. already added. This way, a fresh index.html is created, but with the needed elements.

Then, save the entire output as an output template or as the project default settings (File > Save as Default) so you don't forget to choose that custom template.

Re: [P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Tue Apr 27, 2021 9:38 pm
by dennisvanduijn
Hi Karyn,

I almost always replace the existing online index.html file with the Google Analytics and og: containing one when the official handover to my customer is near. Being able to insert my pieces of html on-the-fly would be awesome. The page you refer to doesn't seem to provide an how-to, would there be a video tutorial be available to do this?

Regards,

Dennis

Re: [P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Tue Apr 27, 2021 11:01 pm
by Hopki
Hi Dennis,
The HTML templates can be found using the Files tab in the Settings/Preferences, see: https://ggnome.com/doc/prefs-settings/#files
You can right button click on the HTML Templates file path to open in Explorer/Finder.
You can then make a copy of the normal.ggt, then using a plain text editor open it up and add your analytics code and save.
If you want to know more about the .ggt files please see: https://ggnome.com/doc/html-template/
Regards,

Re: [P2VR 6.1.11] Media Ended action not working for Youtube videos

Posted: Wed Apr 28, 2021 7:44 am
by dennisvanduijn
Great, thank you Hopki, I will do that!
Regards,
Dennis