asp.net网站如何在数据库中播放保存为二进制的视频 [英] asp.net website how to play video saved as binary in database

查看:61
本文介绍了asp.net网站如何在数据库中播放保存为二进制的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

当我保存带扩展名的视频.mov我可以在所有浏览器上正确播放使用以下代码和VideoHandler

Dears,
when i save video with extension .mov i can play it on on all browsers correctly using the below code with VideoHandler

 <object width="288" height="300" id="MediaPlayer" type="application/x-oleobject"

  standby="Loading Windows Media Player components..." classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"                    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<param name="showControls" value="true">
<param name="autoStart" value="true">
<embed width="288" height="300" src="<%# "VideoHandler.ashx?id=" + Eval("id") %>"

type="application/x-mplayer2" showcontrols="1" autostart="0"></embed>
                </object>





但是当我用扩展名.flv或.swf保存视频时它不起作用,我知道这是正常的,但我使用下面的代码和仍然无法在任何浏览器上播放





but when i save video with extension .flv or .swf it doesn't work, i know this is normal but i used the below code and still can't play on any of the browsers

 <object width="288" height="300" id="MediaPlayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                       type="application/x-oleobject" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<param name="showControls" value="true">
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="autoStart" value="true">
<embed width="288" height="300" src="<%# "VideoHandler.ashx?id=" + Eval("id") %>"
type="aapplication/x-shockwave-flash" showcontrols="1" autostart="0" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
                   </object>





我在视频播放器中收到一条消息:没有插件可用于显示此内容内容

i试图安装插件我得到的消息意味着插件安装并启用也我尝试在线测试它的工作好,所以问题来自我的代码

我该如何解决?



我也需要解决它,因为我读到最好的方法是将所有视频转换为.flv,然后将它们保存到数据库并只使用一个视频播放器(flv)这是对的吗?如果有,有任何方法可以转换它们而不使用任何第三方或任何DLL(我只需要清除代码,免费没有dll没有关闭控件而不是第三方)

Thanksss



and i get a message in the video player: "no plug-in available to display this content"
i tried to to install plug-in i get a message means that the plug-in is installed and enabled also i tried the online test for the player it works good so the problem is from my code
how can i solve it??

also i need to solve it because as i read that the best way is to convert all the videos to .flv before saving them into the db and use only one video player (flv) is this right? if yes is there any method to convert them without using any third party or any dll (i need only the clear code and free no dlls no closed controls not third party)
Thanksss

推荐答案

问题似乎不在于代码而不是导致问题的源文件格式。请注意.MOV,.SWF,.FLV表示存储电影的不同方式(CODEC:更正式的方式)。这与将图像以不同方式保存为.JPEG,.GIF,.PNG,.BMP作为每个存储图像相同。



您需要记住文件将文件另存为数组时的扩展名,以便在重新创建文件时可以将相同的扩展名附加到文件。这可能是最简单的方法,否则将每种格式(.MOV,.SWF等)转换为flv意味着您必须了解每种格式,然后将其转换为.FLV是一项任务。
The problem seems not with the code rather its the source file format that is causing the problem. Please note that .MOV, .SWF, .FLV represent different ways of storing the movie (CODEC: more formal way). This is same as saving an image to .JPEG, .GIF, .PNG, .BMP as each stored image in a different way.

You need to remember the file extension when you save the file as array so that the same extension can be attached to file when you re-create it. This probably is the easiest way otherwise converting each format (.MOV, .SWF, etc) to flv meant you have to understand each format and then convrting it into .FLV is hell of a task.


这篇关于asp.net网站如何在数据库中播放保存为二进制的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆