我需要在vs 2010上播放视频... Plz帮我修补 [英] I need to play videos on vs 2010 ... Plz help me frnds

查看:97
本文介绍了我需要在vs 2010上播放视频... Plz帮我修补的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在服务器上运行该视频o / s ...



我尝试了什么:



< object classid =clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95width =480height =360

codebase = http://www.microsoft.com/Windows/MediaPlayer/\">

< param name =Filenamevalue =C:\ Users \Developer\Documents \ Visual Studio 2010 \Projects \NpsBroadCasting \ AppVideos \\\2.mp4/>

< param name =AutoStartvalue =true/>

< param name =ShowControlsvalue =true/>

< param name =BufferingTimevalue =2/>

< param name =ShowStatusBarvalue =true/>

< param name =AutoSizevalue =true/>

< ; param name =InvokeURLsvalue =false/>

< embed src =C:\ Users \Developer\Documents\Vis ual Studio 2010 \Projects\NpsBroadCasting\AppVideos\2.mp4type =application / x-mplayer2

autostart =1enabled =1showstatusbar =1 showdisplay =1showcontrols =1

pluginspage =http://www.microsoft.com/Windows/MediaPlayer/codebase =http://activex.microsoft.com/activex /controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0

width =480height =360>< / embed>

< / object>

and i need to run that video on server o/s ...

What I have tried:

<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="480" height="360"
codebase="http://www.microsoft.com/Windows/MediaPlayer/">
<param name="Filename" value="C:\Users\Developer\Documents\Visual Studio 2010\Projects\NpsBroadCasting\AppVideos\2.mp4" />
<param name="AutoStart" value="true" />
<param name="ShowControls" value="true" />
<param name="BufferingTime" value="2" />
<param name="ShowStatusBar" value="true" />
<param name="AutoSize" value="true" />
<param name="InvokeURLs" value="false" />
<embed src="C:\Users\Developer\Documents\Visual Studio 2010\Projects\NpsBroadCasting\AppVideos\2.mp4" type="application/x-mplayer2"
autostart="1" enabled="1" showstatusbar="1" showdisplay="1" showcontrols="1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0"
width="480" height="360"></embed>
</object>

推荐答案

浏览器应该可以访问您的源文件。您可能需要在Web应用程序的根目录中移动文件,而不是从C驱动器引用文件,以便在浏览器中托管应用程序的Web服务器可以访问它。



如果您要在应用程序根目录之外存储文件,那么您可以在Web服务器(例如IIS)中创建一个虚拟文件夹,然后配置必要的权限,以便客户端用户可以访问它。



有很多关于你的问题的文章/博客和论坛讨论。你只需要在google上找到它们。
The browser should have access to your source files. Instead of referencing a file from C drive, you may need to move your files within the root of your web application so the web server that hosts your app in the browser can have access to it.

If you are storing files outside of your app root, then you can create a virtual folder in your web server (e.g IIS) and then configure the necessary permissions so client users can have access to it.

There are bunch of articles/blogs and forums discussion regarding your issue. You just need to find them at google.


除了解决方案1之外,你还应该考虑浏览器的兼容性。



< object> 仅适用于Windows上的Internet Explorer。



< embed> 仅在用户安装了Windows Media Player插件时才有效。在Firefox中,默认情况下禁用此插件 [ ^ ]。



64位浏览器也不支持这个插件。



你可能会更好好运使用 HTML5 < video> 元素 [ ^ ]。它受到几乎所有内容的支持[ ^ ]。您仍然可以使用当前代码作为后备。

In addition to solution 1, you should consider browser compatibility as well.

The <object> will only work in Internet Explorer on Windows.

The <embed> will only work if the user has installed the Windows Media Player plugin. In Firefox, this plugin is disabled by default[^].

The plugin is also not supported in 64-bit browsers.

You'd probably have better luck using the HTML5 <video> element[^] instead. It's supported by pretty much everything[^] beyond IE8. You can still use your current code as a fallback.
<video src="/AppVideos/2.mp4" controls autoplay>

    <!-- ActiveX fallback for old IE: -->
    <object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701" type="application/x-oleobject" width="320" height="310">
        <param name="filename" value="/AppVideos/2.mp4" />
        <param name="AutoStart" value="true" />
        <param name="ShowControls" value="true" />
        <param name="BufferingTime" value="2" />
        <param name="ShowStatusBar" value="true" />
        <param name="AutoSize" value="true" />
        <param name="InvokeURLs" value="false" />
        
        <!-- Embed fallback for other old browsers: -->
        <embed src="/AppVideoa/2.mp4" type="application/x-mplayer2" autostart="1" enabled="1" showstatusbar="1" showdisplay="1" showcontrols="1" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" width="320" height="310" />
    </object>
</video>


尝试使用jquery播放器f或者ex:jw player
try to use jquery player for ex: jw player


这篇关于我需要在vs 2010上播放视频... Plz帮我修补的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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