0

I have a Flash player application that plays movies and, if I give it a relative URL, it works fine in the IDE (Flash Pro CC) and on the webserver. The problem is that I need to play a movie that is on the webserver, but in a folder outside of the website (outside of root).

I tried passing the filename as such: "file://C:/Users/MyName/Desktop/Movies/mymovie.mp4". This works fine in the IDE - I can press Ctrl+Enter and the demo works. It also works fine if I test it in a browser (Ctrl+Alt+Enter). But via my IIS server (which is on the same laptop as the IDE), given the same filename, the same application won't play (although, it will play if given a relative URL to a file within the website). Any ideas why not, or what's going on?

These work as they should, in IDE or browser: netStream.Play("Movies/mymovie.mp4"); netStream.Play("http://localhost/Movies/mymovie.mp4");

This works, only in IDE, not in browser: netStream.Play("file://C:/Users/MyName/Desktop/Movies/mymovie.mp4");

I see now, though, that the Flash SWF is on the client browser, and that's the problem. Is there a way to reference a file back on the server, but that sits outside of the website? Maybe something similar to this method: https://forums.adobe.com/thread/838338, but that works for .mp4 files?

swabygw
  • 813
  • 1
  • 10
  • 22
  • Could you, for example, open a local file on the stackoverflow.com server like `c:/dir1/dir2/dir3/file.ext` (supposed that's hosted in a windows environment and served by IIS) directly in your browser ? – akmozo Feb 12 '15 at 08:00
  • Yes - within the application I open and close files several times using the URLLoader/URLRequest method. And, the netStream.Play(xxx) method works on a URL (whether relative or absolute). It also works on an absolute path, but only in the IDE. But, I need it to work on an absolute path from the browser. I'll add some more description to my original post. – swabygw Feb 12 '15 at 14:23
  • I see your point now - the Flash object is at the client window, so it's attempting to open a file on their machine, not the server. Is there a way to reference a file back on the server, but that sits outside of the website? Such as a request loader of some sort? – swabygw Feb 12 '15 at 14:29
  • You can try to use a server side script which can access to video (your local video) and stream it to your player like : `ns.play('http://server/script');` and inside the script : `stream_this_local_file('c:\videos\video01.mp4')`. – akmozo Feb 12 '15 at 17:39
  • Thanks, akmozo. I got this to work by using the appendBytes method on a URL pointed at an ASP page which handles and filestream's the video file. It works, but I realize now that a "handler" ASP page, which everyone recommends for protecting files from download, is, itself, actually a hole into the system. – swabygw Feb 13 '15 at 00:49

0 Answers0