Video in iFrame continues to play after iFrame is closed...

For general questions about Content Authoring

Moderator: Nav

Video in iFrame continues to play after iFrame is closed...

Postby Randall Smith » Fri Feb 18, 2011 7:15 am

I tried controlling the iFrame by using refresh to stop the video content from continuing to play; that worked except that the YouTube video no longer opens and plays if you re-open the iFrame, it’s just a blank white space. It’s not a big deal since navigating away from the page and back resets the YouTube content and it plays normally again.

Nav responded:

Yes, I think when the IFrame is told to go away, it just hides it, but doesn't remove it completely. This is so that if you want to show it again, it will be in the same state you left it.

However, you can set the URL of the IFrame object using an action so you can send it off to some other place before hiding it. Of course, when you come back, you'll probably need to update the URL back to the original.

Your action would look like this:

Trigger: Show Button > onClick
Response: IFrame object > setURL > "http://www.youtube.com/videoLink"
Response: IFrame object > show

Trigger: Hide Button > onClick
Response: IFrame object > setURL > ""
Response: IFrame object > hide

Actually, I'm not sure you even have to hide it after you tell it to go nowhere. Also, if you leave the page and come back, you don't necessarily have to set the URL back to it's original state, it will just automatically do it.

NOTE: I am using embedded code to display a video so I didn't use the setURL action when opening the iFrame. I did use the setURL > "" command when the iFrame display was closed and this did prevent the video from continuing to play.

Thanks, Nav.
Randall Smith
 
Posts: 40
Joined: Mon Sep 10, 2007 2:25 pm
Location: Madison, WI

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Not able to open ./cache/data_global.php