Close video in external HTML document

Q&A about the latest versions
Post Reply
JSchrader
Posts: 141
Joined: Sat Nov 28, 2015 2:26 pm

Inside a tour I'm openeing an external HTML document.
The document is shown inside a textfield with an iframe like

Code: Select all

<iframe width="100%" height="100%" src="mydocument.html" frameborder="0"></iframe>
The html document contains amongst other media also a video.

The problem is, when the video is running and the user closes the textfield the video will continue as the close-button cannot diretly influence the video.

Is there a way to stop the video when the window is closed?
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

I think the easiest way would be to add a "set value" action - target textbox where you replace the textbox text with an empty string on close. Of course then you also need to make the set value on open to put the iframe code into the text box every time it opens.
MfG, Thomas
JSchrader
Posts: 141
Joined: Sat Nov 28, 2015 2:26 pm

Finally I found the time to check that out.
With a single text it certainly would work.

But in my case it's a bit more complicated as I use a logic block to fill in the text.

I can stop the video with a click on the close button in that I send an empty value to the textbox.
But on the next time I try to open the textbox it's empty, which seems logical as I emptied it with the click on the close button.
However, when in the meantime I perform a task that will change any of the values of the logic block (Tag, language), the textbox works as it should.

So what could be a workaround?
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi J,
If your using a logic block to set text to the text box you would use a numbered variable with 0 being no text, blank.
A variable of 1, being the first iframe, 2 being the next and so on.
So on close you would set the variable to 0 to unload the iframe and video.
When you open the video it would also have a set variable value action to the number for the required video to play.
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/
Post Reply