Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to mediate a SWF-Flashfile using a PHP mediating a.k.a. HTTP-Pseudostreaming script?
    primarykey
    data
    text
    <p>I'm writing a simple small context media platform. It is mainly based on so called HTTP Pseudostreaming, where I mediate the media file using a php script. This is used for checking access to the file, and for linking to the correct directory. In the following the basic parts of my code:</p> <pre><code>// [...] header("Content-type: " . $file_type); header("Content-length: " . $file_size); header("Content-Disposition: attachment; filename=" . $file_name); header("Expires: " . gmdate ("D, d M Y H:i:s", (time () + $_CFG['FILE_EXPIRE_TIME']))); header("Last-Modified: " . gmdate ("D, d M Y H:i:s", filemtime($file_path))); $file_handle = fopen($file_path, "r"); while (!feof($file_handle)) { print(fread($file_handle, FILETRANSFER_BUFFER_SIZE)); } fclose($file_handle); // [...] </code></pre> <p>Currently i use this script to relay mp3, flv, mp4, pdf and image formats. This works pretty good. Furthermore i wanted to add Flash support (swf). However the file gets transferred. The HTTP Header that is sent by the server also seems to be okay:</p> <pre><code>HTTP/1.1 200 OK Date: Wed, 08 Feb 2012 08:49:16 GMT Server: Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g mod_perl/2.0.4 Perl/v5.10.0 X-Powered-By: PHP/5.2.6-1+lenny9 Expires: Thu, 07 Feb 2013 08:49:16 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-length: 28869 Content-Disposition: attachment; filename=SWFTest1.swf Last-Modified: Tue, 07 Feb 2012 08:31:00 Content-Type: application/x-shockwave-flash </code></pre> <p>The only problem is: if I want to play this flash file from Browser (independent from Browsertype) it doesn't work. The flasharea stays blank. If I link directly to the same .swf file it works. If I download using my relaying script and play the flashfile locally: It works.</p> <p>My calling DHTML/JavaScript lines are:</p> <pre><code>&lt;script type="text/javascript" src="swfobject.js"&gt;&lt;/script&gt; &lt;div style="margin: 5px;" id="flashcontent"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; var s1 = new SWFObject("file.php?id=236&amp;type=media", "flashfile", "480", "360", "7"); s1.addVariable("width","480"); s1.addVariable("height","360"); s1.write("flashcontent"); &lt;/script&gt; </code></pre> <p>Any Ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload