开发者

How to embed a quicktime video from a MySQL Blob

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 m开发者_JAVA技巧ovie 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">
<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/"></embed>

</object> 

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜