嵌入到 HTML 中的 Windows 媒体播放器控件 - 开始播放后更改控件的大小
我使用以下 html 在 IE 8 中呈现的网页上显示媒体播放器:
<OBJECT type="application/x-ms-wmp" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" width="200" height="200">
开始播放后,控件的大小保持不变。
但是,当我在 JavaScript 中动态创建控件时,启动视频后控件会增加到视频的大小。这是代码:
player = document.createElement('object');
player.setAttribute("classid", "CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6");
player.setAttribute("type", "application/x-ms-wmp");
player.setAttribute("width", "200");
player.setAttribute("height", "200");
这是一个错误还是我遗漏了一些东西?如何保留与控件原始大小相同的视频大小?
谢谢。
PS 顺便说一句,如果我在 JavaScript 中以不同的顺序设置控件的属性(“type”之后的“classid”),则控件不会呈现。你知道可能会出现什么问题吗?
I use the following html to show media player on the web-page rendered in IE 8:
<OBJECT type="application/x-ms-wmp" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" width="200" height="200">
After starting playback the size of the control stays the same.
However, when I create the control dynamically in JavaScript, after starting the video the control increases to the size of the video. Here is the code:
player = document.createElement('object');
player.setAttribute("classid", "CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6");
player.setAttribute("type", "application/x-ms-wmp");
player.setAttribute("width", "200");
player.setAttribute("height", "200");
Is it a bug or am I missing something? How can I preserve the same size of the video as the original size of the control?
Thank you.
P.S. Btw, if I set control's attributes in JavaScript in different order ("classid" after "type"), then control does not render. Do you know what might be a problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您最好使用 swfobject 库来嵌入视频,特别是如果您随后需要使用 javascript 对其进行操作。
此论坛帖子可能相关:http://forums.adobe.com/message/3331660
-安德里安
You better use the swfobject library for embedding videos, especially if you need to manipulate it with javascript afterwards.
This forum post might be relevant: http://forums.adobe.com/message/3331660
-Andrian