2
votes

I have created a SWF file using Flash that loads an FLV file on my local development machine. When publishing the SWF file and generating the appropriate HTML, I can successfully load the video by opening the generated HTML page that Flash creates. However, when placing the generated HTML code in my View, the Flash is loading, but the video is not playing. I think it's a reference error to the location of the FLV file, but I've tried every combination I can think of. I placed the SWF and FLV in the corresponding View folder where I want the video to load, but to no avail. Does anyone have a working example that I can look at, or any suggestions? Thanks.

2

2 Answers

2
votes

I think it's a reference error to the location of the FLV file, but I've tried every combination I can think of.

Yes, I think so as well. Have you tried using Url helpers to reference static resources on your site, like

@Url.Content("~/Content/Videos/MySupervideo.flv")
1
votes

The actual solution to this for me was this...

In your Flash file, the Component Inspector should point to the location on the web server where the FLV file is located...

Publish the SWF, copy the appropriate HTML to the View you would like the video to play in...

And just as Darin has pointed out, use the Helpers to write the path to the SWF file on your web server where it is located. The only difference is this (which I discovered using Google's 'Inspect Element' feature and then clicking on the 'Network' item, then clicking the path loaded on the left for the 'SWF'... on the right it stated 404 Status Not Found... why?

@Url.Content("~/Content/video/name-of-swf.swf") actually produced 
src='http://localhost/content/video/name-of-swf.swf.swf'

This obviously incorrect... so here is the correct way to use the Helpers...

@Url.Content("~/Content/video/name-of-swf")

Hope this helps someone... I am giving Darin credit because he pushed me in the right direction...