Flash/SWF/FLV embedding problem (Controls and Skin)
Are you having a problem with embedding of flash files on your site, where the controls/skin isn't showing, but they do show if you access the SWF directly?
I am not a big fan of Flash. And I have never used it on any of my websites. Unfortunately though, I have been redesigning a website for a friend which has forced me into this realm of Flash Frustration™. There are about 400 flash videos on this site, so it is impossible to convert them to an alternate format.
Basically the site was completely static, and maintenance was time consuming. So I am changing it to be dynamic (database driven ASP). Each SWF file has a skin, which allows controls like Play and Stop etc. The problem is when you are using an ASP page to load content from a database, that asp file exists once, to load all content (of the specific type). Therefore you cut out having to have 1 htm file for each SWF file. Sounds great. However, in all of Adobe's brilliance they decided that you have to have the SWF(skin and controls/loader), FLV (actual video) and HTM (with the EMBED code) in the same folder. This is just dumb. Anyway, one solution would have been to copy all the SWF and FLV files to one folder (the folder where the ASP file was). This would be a nightmare!
I had to find a workaround. I have been google'ing for the past 3 hours on this issue. Unfortunately, all that did was confirm the fact that the files all need to be in the same place. I needed to somehow make the swf/flv files think that they were being called from the same folder. I looked up methods of URL rewriting. That didn't help much.
Solution
I then pulled back from the problem and though of something. iFrames! Yep, that simple. It works flawlessly. You don't have to have a dynamic page (ASP or PHP), you could just use a plain old HTML file.
So, lets say you have a SWF file: \media\movies_action\themovie.swf
You have an HTML page in folder: \main\
If you try the traditional <embed>/<object> method, the file will probably play, but you won't have any controls or skin.
So instead...inside the html file, just put this code :
<iframe src="\media\movies_action\themovie.swf" frameborder="0" width="400px" height="300px"> </iframe>
This will create a 400x300 pixel iframe which has the flash file playing, with all the controls in place! Easy. Let me know if this helped you out.
Meta
Categories
Sponsors
Recent Posts
- Fail Compilation Video February 2011
- Cybersex with a twist
- Scam artist on Facebook – Final Part
- Facebook: Download your entire history!
- Scam artist on Facebook – part 4
- Scam artist on Facebook – part 3
- Scam artist on Facebook – Part 2
- Scam artist on Facebook – Part 1
- How fast are F1 cars really?
- 10 things every 20 year old male should know
April 20th, 2008 - 23:48
been stuck trying to find a solution to this for ages. such a simple solution….thank you!
May 27th, 2008 - 10:02
Fucking AWESOME! Great solution!!!
December 18th, 2008 - 00:09
Thank you for this! Totally worked for me, been looking for hours too and nothing worked until this!
December 18th, 2008 - 17:02
Does anyone know if there is code i can include with this to stop it from autoplaying? I want the user to have to press play to start the video. Any help would be great, thanks!
December 21st, 2008 - 23:41
Hi Michelle, I think that is inherent to the way the SWF file was originally made. If you created the file yourself, then you can try modify it at the source.
January 20th, 2009 - 04:51
i tried to copy and paste your code in html (ofcourse corrected the file name) but i might be missing something.. it gives me error. where exactly in Dreamweaver CS3 shud i insert?
April 1st, 2009 - 20:06
The controls aren’t showing up for me. Is it dependent some settings in the server?
April 1st, 2009 - 20:15
Hi Jon,
It shouldn’t be server dependant. When you load the SWF file on your pc from your local drive, can you see the controls?
June 4th, 2009 - 03:46
Fantastic Solution – Thank you, Thank you!!
June 10th, 2009 - 13:24
hi,
I am also not getting controls…..
Any solution???
August 10th, 2009 - 08:34
for some reason it won’t work on Firefox. Works fine on IE.
November 25th, 2009 - 00:25
Not getting the controls either!
March 10th, 2010 - 03:05
Thanks! This worked great! had to swap out the “quotes” to make it work (hint, hint… everyone else)
April 13th, 2010 - 17:18
good one, works flawlessly!
July 30th, 2010 - 01:11
Thank you, i spent around 5 hours or experimenting/frustration.
Great:-)
July 30th, 2010 - 01:35
One more thing, it works locally but not online, i have uploaded all my files and nothing, kind of back to square 1? any REAL solutions?
thanks
October 13th, 2010 - 23:02
Thanks, this finally solved it…
December 15th, 2010 - 09:27
Great!!!! Pheeeewwwwww! Thanks
March 19th, 2011 - 18:24
Great solution dude – you made my day!
July 4th, 2011 - 22:51
please tell me where to put those code in my html…. please
August 1st, 2011 - 14:59
this is awesome! i just wasted 2 days trying to fix this problem. you are a genius!
November 7th, 2011 - 01:11
Can see the fist frame but the movie is not playing or showing controls…
Tried IE and Firefox.
BACK TO GOOGLE!
December 15th, 2011 - 19:13
Thank you so much for this solution! Have spent hours looking for this!
Much appreciated!
January 6th, 2012 - 03:48
Thank you!, Thank you!, Thank you!, Thank you!, and Thank you!
That’s what I call thinking outside of the box.. Or frame