object tag is not working in chrome to play video

1.5k Views Asked by At

I am using the following code to play video in the browser by getting the src path from the server:

<object id="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows® Media Player components..." type="application/x-oleobject" width="280" height="256">
   <param name="src" value="C:\Users\Public\Videos\Sample Videos\fp.avi" />
   <param name="animationatStart" value="true">
   <param name="transparentatStart" value="true">
   <param name="autoStart" value="true">
   <param name="showControls" value="true">
   <param name="Volume" value="-450">
   <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="C:\Users\Public\Videos\Sample Videos\fp.avi" name="MediaPlayer1" width=280 height=256 autostart=1 showcontrols=1 volume=-450>
</object>

I want to give it a local path to test the code. Here I am using a video file with .avi extension.

It works fine in mozilla and internet explore, but it not in chrome. Any idea why?

1

There are 1 best solutions below

0
On

That should work in Chrome as the code is written above. Make sure that the correct program/extension/plugin is trying to play your .avi. Make sure first of all that you have the correct browser plugin. For example, the Chrome plugin. There is a corresponding plugin for Firefox at the same site. If something else is trying to render your .avi, you may not be getting the desired behavior.

BTW, if the link tells you the service is not available or something to that effect, try again later. It will work ...