I am obfuscating file locations and simultaneously checking permissions to view files by locating certain files above web root and using a proxy script to manage permissions.
As can be imagined, I'm having a really tough time supplying these mp4's to Flash for playback. Actually I've achieved succes in many areas, and there seems to be one last thing to hook this up... this is where I'd like feedback and hopefully some clues toward a solution.
It has occurred to me that setting these files up on a different server and applying a cross-domain policy would be easier than what I'm doing... because it would be functionally equivalent, but I don't want to organize another set of server resources, and I've already created a fallback solution which actually doesn meet my objective on equivalent terms- it's just not as elegant as what I would like to do.
I have AS2 code which successfully sets contentPath to a proxy script: "http://example.com/myproxy.php?filename=defaultVideo.mp4" and gets an appropriate response from the server- it accurately represents the response the exact same way that my other flash players get with standard URL's with the same content headers, video/mp4 content type, accept-ranges: bytes, etc. This was quite a trick using nginx and wordpress, but I made it happen.
My script retrieves the data using fpassthru().
however, as might be expected contentPath doesn't (seem) to like the data, at least, it's not triggering the right things as other normal url's do, so as far as my script is concerned, it isn't "loading" even though I'm seeing all the data transferred in the exact same # of bytes when not using the proxy script.
I figured I could at least try this approach much like setting an <img src="data:image/png;base64..." Does anyone have successful experience providing content as data in this regard? I know that many things are possible with ByteArray in AS3, but we're talking about video content here- specifically .mp4
I have 3 sets of erroneous results which allow me to hold out hope I can just hook it up the way I'm trying
1. Flash is appending a query var to my POST so the request actually looks like: "http://example.com/myproxy.php?filename=defaultVideo.mp4&FLVPlaybackVersion=1.0.2". This tells me some interesting facts about how Flash uses .contentPath, and what happens when I provide a normal URL. Although I believe I'd need to hack the source code better to understand it... not that I'm above hacking. I just don't understand how or why this is occurring. I thought of using Video Class instead of FLVPlayback Class, but I don't want to change a working script until I tackle this one issue.
2. I have an issue with a different script now and can't seem to communicate properly on the receiving part after sendAndLoad(). It sends fine but doesn't seem to receive anything into result_var... I am also not getting positive results in my content headers (0 bytes saying transferred unlike the perfect looking stats from the main script), so I don't know at this point if it's my issue on the properly forming content headers (which AFAIK shouldn't really be an issue- just echo stuff and SOMETHING should come across) so now my questions are forked between issues and I'll have to report on the results of that.
3. When I use just my regular flash player without any tricky script involved, clicking my (custom) play button in the AS2 code seems to trigger jquery when I look at the web stats, but when I trigger all my events using the custom code it uses XHR- even though that's not really expected.
At this point I believe I have 1 of 2 issues: either I'm just not getting results at all into Flash and only believing that's happening- or I'm hopeless in this because there's no way to tell FLVPlayback that my data connects with the URL it's expecting from contentPath even though it looks like the result is (technically, somewhat) the same from an ordinary call to a normal URL.
Any help or insight into the inner workings of flash would be appreciated.
I'm also getting erroneous results wery telling erroneous results from this, but because I have a related issue using a different code system I'm now wondering if my conceptual method is working but I'm just not getting communication between the php script and Flash. For example, I do not get results when I simply provide a valid url via