CodeOverload
CodeOverload

Reputation: 48465

Can't change the flash file later with swfobject

I use swfobject to load a youtube embedded video, it works nice, but when i try to load another youtube video after a specific time it doesn't work, It looks like the container div is totally replaced with the swf instead of putting it inside it.

Note: i attempt using swfobject.embedSWF(path,divID,width,height) to load other videos which doesn't work.

Any ideas?

Upvotes: 0

Views: 1108

Answers (2)

rusty
rusty

Reputation: 499

I know this is an older post, but just thought I'd mention that I ended up just using the YouTube javascript API to switch the video. Simpler, and the transition looks cleaner than trying to remove the object and add another one.

Upvotes: 1

pipwerks
pipwerks

Reputation: 4581

SWFObject v2.x replaces the target HTML element with an <object>.

If you want to use the same target element for multiple SWF embeds, you'll need to re-create the target element before attempting your subsequent embed. Here's a link to a tutorial for this topic (scroll down to "Replacing a loaded SWF with another SWF").

Upvotes: 2

Related Questions