Javascript 如何将 mpg 嵌入到我的网页中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10009918/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I embed an mpg into my webpage
提问by Wermerb
I would like to embed mpg (dvd compliant mpeg2) movie files to my web page. I do not have any chance to convert these videos to any other format. This web is only for personal use so any type of solution would be perfect.
我想将 mpg(兼容 dvd 的 mpeg2)电影文件嵌入到我的网页中。我没有机会将这些视频转换为任何其他格式。该网站仅供个人使用,因此任何类型的解决方案都是完美的。
Really appriciate any advice or solution.
真正理解任何建议或解决方案。
Here is my code:
这是我的代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<embed src="my_video.mpg" autostart="false" height="350" width="500" />
</body>
</html>
SOLVED:
解决了:
My solution for this problem was that i had to reinstall the wmp plugin for my browsers and its working fine
我对这个问题的解决方案是我必须为我的浏览器重新安装 wmp 插件并且它工作正常
回答by Saeid Yazdani
Try this (Works with IE)
试试这个(适用于 IE)
<EMBED SRC="movie.mpg" AUTOPLAY=true WIDTH=160 HEIGHT=120></EMBED>
edit: Hmmm that works for me. You can try this as an alternative:
编辑:嗯,这对我有用。你可以试试这个作为替代:
<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="fileName" value="your_file.mpg">
<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="your_file.mpg" name="MediaPlayer1" width=280 height=256 autostart=1 showcontrols=1 volume=-450>
</object>
Also make sure you have the right codecs installed on your PC
还要确保您的 PC 上安装了正确的编解码器
回答by afaf12
<video width="500px" height="350px" autobuffer="autobuffer" autoplay="autoplay" loop="loop" controls="controls">
<source src='my_video.mpg' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>