Click here to Skip to main content
15,910,210 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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>
Posted
Updated 9-Aug-16 21:11pm

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.
 
Share this answer
 
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.
HTML
<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>
 
Share this answer
 
Comments
Vincent Maverick Durano 10-Aug-16 6:10am    
5ed! very well said.
try to use jquery player for ex: jw player
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900