how to play videos in .avi file format in chrome?

不羁的心 提交于 2019-12-03 22:14:28

问题


Technically It was possible to play .avi files by loading an embedded object for a external player directly in the HTML. Now chrome deprecated that capabitilities and the solution left it's to transcode all my video files into .mp4

Edited Because I don't own the files I don't pretend to transcode them. I'm looking forward for a way to re-enable the old embedded objects to play those files into the browser. Chrome is required

For firefox a solution would be:

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <object id="MediaPlayer1" width="690" height="500" 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">
    <param name="FileName" value='My File Name' />
    <param name="AutoStart" value="True" />
    <param name="DefaultFrame" value="mainFrame" />
    <param name="ShowStatusBar" value="0" />
    <param name="ShowPositionControls" value="0" />
    <param name="showcontrols" value="0" />
    <param name="ShowAudioControls" value="0" />
    <param name="ShowTracker" value="0" />
    <param name="EnablePositionControls" value="0" />
    <embed  type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
           src='MY_AVI_FILE.avi' align="middle" width="600" height="500" defaultframe="rightFrame"
           id="MediaPlayer2" />
</body>
</html>

回答1:


There are only a few file video formats which can be played in most browsers. Chrome probably does not want to support non-standard formats and thus pollute the Web with incompatible content.

Here are the video formats supported by various browsers:

+--------------------+----------------------+-------+-----+
|      Browser       |         MP4          | WebM  | Ogg |
+--------------------+----------------------+-------+-----+
| Internet Explorer  | YES                  | NO    | NO  |
| Chrome             | YES                  | YES   | YES |
| Firefox            | YES                  | YES   | YES |
| Safari             | YES                  | NO    | NO  |
| Opera              | YES (from Opera 25)  | YES   | YES |
+--------------------+----------------------+-------+-----+



回答2:


I invented an alternative for Npapi windows media player!

My windows program is an extension for all browsers installed on the computer. And it can be very interesting complement any browser functionality. For example I have added to my site (example site, with part of code: http://master255.org/) mpc-hc player with feedback to view any video from the site.

It sounds fantastic? But it works! :-D

Program Code:

https://github.com/master255/Redirector

Download:

http://master255.org/setup/setup.exe

Enjoy!



来源:https://stackoverflow.com/questions/32628054/how-to-play-videos-in-avi-file-format-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!