tags:

views:

202

answers:

1

Hi, I am currently pulling out images from a MySQL Blob using code as follows:

<img src="data:<?php echo $type; ?>;base64,<?php echo base64_encode($file); ?>" width="240"/>

I am now trying to embed a movie in a page and I am currently using code as follows:

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="256" width="320">
<param name="src" value="http://www.yourdomain/your-video.mov"&gt;
<param name="autoplay" value="true">
<param name="type" value="video/quicktime" height="256" width="320">

<embed src="<?php echo base64_encode($file); ?>" height="256" width="320" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"&gt;&lt;/embed&gt;

</object>

I'm not sure how to go about actually grabbing the data? Any ideas?

+2  A: 

Refer the video to a URL like:

http://www.yourdomain/video.php?video_id=1234

In video.php, notify to the browser about the MIME type via the Content-Type header that you can send with the header() function.

BTW, it's the first time that I see someone uses the method you've shown to display an image. Usually, you'd want to refer to a URL like the example above. That's because that the browser will save the image in the cache, which will make your website to load faster.

Dor