如何在我的 html 文件中嵌入 WMV 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2538724/
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 to embed WMV files in my html file
提问by Michel
i have made some demo movies in WMV format that i want to embed in my html page. I've found some code to do that, but one thing annoys me: it shows a black front in stead of a picture of the first frame. And i can ofcourse put some descriptive text around the frames/movies, but it isn;t such a nice sight: all black squares with a play button beneath it. What do i have to do to show a (first) frame of the movie?
我制作了一些 WMV 格式的演示电影,我想将它们嵌入到我的 html 页面中。我找到了一些代码来做到这一点,但有一件事让我很恼火:它显示了一个黑色的正面而不是第一帧的图片。而且我当然可以在帧/电影周围放置一些描述性文字,但这不是一个很好的景象:所有黑色方块下面都有一个播放按钮。我必须做什么才能显示电影的(第一)帧?
This is my code:
这是我的代码:
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Microsoft? Windows? Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsm p2inf.cab#Version=6,4,7,1112">
<param name="filename" value="http://www.ladieda.com/mymovie.wmv">
<param name="autoStart" value="false">
<param name="showControls" value="true">
<param name="AllowChangeDisplaySize" value="true">
<param name="ClickToPlay" value="true">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" SRC="http://www.ladieda.com/mymovie.wmv" AutoStart="false" ></embed>
</object>
Michel
米歇尔
Ps tried it in IE8 and FF3.6, both showed up black.
ps在IE8和FF3.6下试过,都显示黑色。
回答by Buhake Sindi
My example works.
我的例子有效。
<object id='mediaPlayer' width="320" height="285"
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="http://www.ladieda.com/mymovie.wmv">
<param name='animationatStart' value='true'>
<param name='transparentatStart' value='true'>
<param name='autoStart' value="false">
<param name='showControls' value="true">
<param name='loop' value="true">
<embed type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
bgcolor='darkblue' showcontrols="true" showtracker='-1'
showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285"
src="http://www.ladieda.com/mymovie.wmv" autostart="true" designtimesp='5311' loop="true">
</embed>
</object>
Your example was modified to work:
您的示例已修改为工作:
<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Microsoft? Windows? Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsm p2inf.cab#Version=6,4,7,1112">
<param name="fileName" value="http://www.ladieda.com/mymovie.wmv">
<param name="autoStart" value="false">
<param name="showControls" value="true">
<param name="AllowChangeDisplaySize" value="true">
<param name="ClickToPlay" value="true">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="http://www.ladieda.com/mymovie.wmv" autoStart="false" ></embed>
</object>
And yes, it works both on Firefox 3.6 and IE8 (I tested it myself).
是的,它适用于 Firefox 3.6 和 IE8(我自己测试过)。
回答by Web Developer
<param name="fileName" value="http://www.ladieda.com/mymovie.wmv"> is good for ff
for IE should use name="URL"
对于 IE 应该使用 name="URL"
too lazy to provide link to msdn.
懒得提供 msdn 的链接。