如何使用javascript更改quicktime src? [英] howto change quicktime src with javascript?

查看:64
本文介绍了如何使用javascript更改quicktime src?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我正在尝试用javascript 更改quicktime嵌入对象的src:


< html>< body>

< script language =" JavaScript">

function Exchange()

{

document.qtvr.src =" sample2.pano";

document.embeds [" mov"]。src =" sample2.mov";

}

< / script>

< object classid =" clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"

width =" 600" height =" 400"

codebase =" http://www.apple.com/qtactivex/qtplugin.cab" id =" qtvr">

< param name =" autoplay" value =" true">

< param name =" controller" value =" true">

< param name =" pluginspage"

value =" http://www.apple.com/quicktime/download /indext.html">

< param name =" target" value ="我自己>>

< param name =" type" value =" video / quicktime">

< param name =" src" value =" sample1.pano">

< embed src =" sample1.mov"宽度= QUOT; 600"高度= QUOT; 400" autoplay =" true"

controller =" true" border =" 0"

pluginspage =" http://www.apple.com/quicktime/download/indext.html"

target =" own"类型= QUOT;视频/ Quicktime和QUOT; name =" mov">< / embed>

< / object>


< a href ="#" onclick =" javascript :交换()">交换< / a>

< / body>< / html>

但IE表示document.embeds.mov.src不是对象,而且当用户点击链接时,图像

没有改变(IE,Mozilla) ;交换"。

有什么问题,如何正确地做到这一点?

提前感谢。

Hello everybody.
I''m trying to change src of quicktime embedded object with javascript:

<html><body>
<script language="JavaScript">
function Exchange()
{
document.qtvr.src = "sample2.pano";
document.embeds["mov"].src = "sample2.mov";
}
</script>

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="600" height="400"
codebase="http://www.apple.com/qtactivex/qtplugin.cab" id="qtvr">
<param name="autoplay" value="true">
<param name="controller" value="true">
<param name="pluginspage"
value="http://www.apple.com/quicktime/download/indext.html">
<param name="target" value="myself">
<param name="type" value="video/quicktime">
<param name="src" value="sample1.pano">
<embed src="sample1.mov" width="600" height="400" autoplay="true"
controller="true" border="0"
pluginspage="http://www.apple.com/quicktime/download/indext.html"
target="myself" type="video/quicktime" name="mov"></embed>
</object>

<a href="#" onclick="javascript:Exchange()">exchange</a>
</body></html>

but IE said that "document.embeds.mov.src is not object", and image
isn''t changed ( IE,Mozilla) when user click on the link "exchange".
What is wrong, how to do this correctly?
Thank in advance.

推荐答案

Encapsulin写道:
Encapsulin wrote:
各位大家好。
我正在尝试用javascript 更改quicktime嵌入对象的src

< html>< body>
< script language =" JavaScript">
function Exchange()
{
document.qtvr.src =" sample2.pano";
document.embeds [" mov"]。src =" sample2.mov";
}
< / script> ;< object classid =" clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width =" 600" height =" 400"
codebase =" http://www.apple.com/qtactivex/qtplugin.cab" id =" qtvr">
< param name =" autoplay" value =" true">
< param name =" controller" value =" true">
< param name =" pluginspage"
value =" http://www.apple.com/quicktime/download/indext.html">
< param name =" target" value ="我自己>>
< param name =" type" value =" video / quicktime">
< param name =" src" value =" sample1.pano">
< embed src =" sample1.mov"宽度= QUOT; 600"高度= QUOT; 400" autoplay =" true"
controller =" true" border =" 0"
pluginspage =" http://www.apple.com/quicktime/download/indext.html"
target ="我自己"类型= QUOT;视频/ Quicktime和QUOT; name =" mov">< / embed>
< / object>

< a href ="#" onclick =" javascript :Exchange()">交换< / a>
< / body>< / html>

但IE表示那个document.embeds.mov.src不是对象,当用户点击链接交换时,图像
不会改变(IE,Mozilla)。
有什么问题,如何正确地做到这一点?
提前感谢。
Hello everybody.
I''m trying to change src of quicktime embedded object with javascript:

<html><body>
<script language="JavaScript">
function Exchange()
{
document.qtvr.src = "sample2.pano";
document.embeds["mov"].src = "sample2.mov";
}
</script>

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="600" height="400"
codebase="http://www.apple.com/qtactivex/qtplugin.cab" id="qtvr">
<param name="autoplay" value="true">
<param name="controller" value="true">
<param name="pluginspage"
value="http://www.apple.com/quicktime/download/indext.html">
<param name="target" value="myself">
<param name="type" value="video/quicktime">
<param name="src" value="sample1.pano">
<embed src="sample1.mov" width="600" height="400" autoplay="true"
controller="true" border="0"
pluginspage="http://www.apple.com/quicktime/download/indext.html"
target="myself" type="video/quicktime" name="mov"></embed>
</object>

<a href="#" onclick="javascript:Exchange()">exchange</a>
</body></html>

but IE said that "document.embeds.mov.src is not object", and image
isn''t changed ( IE,Mozilla) when user click on the link "exchange".
What is wrong, how to do this correctly?
Thank in advance.



要更改QT电影的来源,你可以像这样使用SetURL方法,

document.getElementById(" qtvr")。SetURL(" sample2.mo v");


虽然上面包含的示例代码包含已弃用的

功能和错误,我必须留给别人修理。


Andrew Poulos


To change the source of a QT movie you use the SetURL method like so,
document.getElementById("qtvr").SetURL("sample2.mo v");

Though the sample code you''ve included above contains deprecated
features and mistakes which I have to leave to someone else to fix.

Andrew Poulos


Andrew Poulos写道:
Andrew Poulos wrote:
Encapsulin写道:
Encapsulin wrote:
[...]
< object classid =" clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ;
width =" 600" height =" 400"
codebase =" http://www.apple.com/qtactivex/qtplugin.cab" id =" qtvr">
< param name =" autoplay" value =" true">
< param name =" controller" value =" true">
< param name =" pluginspage"
value =" http://www.apple.com/quicktime/download/indext.html">
< param name =" target" value ="我自己>>
< param name =" type" value =" video / quicktime">
< param name =" src" value =" sample1.pano">
< embed src =" sample1.mov"宽度= QUOT; 600"高度= QUOT; 400" autoplay =" true"
controller =" true" border =" 0"
pluginspage =" http://www.apple.com/quicktime/download/indext.html"
target ="我自己"类型= QUOT;视频/ Quicktime和QUOT; name =" mov">< / embed>
< / object>

< a href ="#"的onclick = QUOT;的JavaScript的 的:交流()">交换< / A>


`javascript :''不属于内部事件处理程序。声明

head'

元素中的事件处理程序属性的默认脚本语言:


< meta http -equiv = QUOT;内容脚本的类型" content =" text / javascript">


应该正确取消click事件,并且应该写出仅限脚本的链接

通过脚本:


< script type =" text / javascript">

document.write(''< a href ="# " onclick =" Exchange();''

+''返回false;">交换< \ / a>'');

< ; / script>

< / body>< / html>

但IE表示document.embeds.mov.src不是对象,而且图片当用户点击链接交换时,
没有改变(IE,Mozilla)。
有什么问题,如何正确地做到这一点?
提前感谢。
要更改QT影片的来源,请使用SetURL方法,例如:
document.getElementById(" qtvr")。SetURL(" sample2.mo v");
[...]
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="600" height="400"
codebase="http://www.apple.com/qtactivex/qtplugin.cab" id="qtvr">
<param name="autoplay" value="true">
<param name="controller" value="true">
<param name="pluginspage"
value="http://www.apple.com/quicktime/download/indext.html">
<param name="target" value="myself">
<param name="type" value="video/quicktime">
<param name="src" value="sample1.pano">
<embed src="sample1.mov" width="600" height="400" autoplay="true"
controller="true" border="0"
pluginspage="http://www.apple.com/quicktime/download/indext.html"
target="myself" type="video/quicktime" name="mov"></embed>
</object>

<a href="#" onclick="javascript:Exchange()">exchange</a>
`javascript:'' does not belong into intrinsic event handlers. Declare
the default scripting language for event handler attributes in the `head''
element instead:

<meta http-equiv="Content-Script-Type" content="text/javascript">

The `click'' event should be canceled properly, and the script-only link
should be written via script:

<script type="text/javascript">
document.write(''<a href="#" onclick="Exchange();''
+ '' return false;">exchange<\/a>'');
</script>
</body></html>

but IE said that "document.embeds.mov.src is not object", and image
isn''t changed ( IE,Mozilla) when user click on the link "exchange".
What is wrong, how to do this correctly?
Thank in advance.
To change the source of a QT movie you use the SetURL method like so,
document.getElementById("qtvr").SetURL("sample2.mo v");




document.applets [" qtvr"]。SetURL(" sample2.mov");


s应该足够了。但是,假设QuickTime

插件总是用于显示此对象,因此可以使用SetURL()

方法; `param''元素''的值不一定是
跟着,'data''属性丢失了,代码库的格式是

,这是不可理解的在非Windows系统上。这里是Mozilla / 5.0

(X11; U; Linux i686; en-US; rv:1.8)Gecko / 20051224 Debian / 1.5.dfsg-3

Firefox / 1.5 Mnenhy / 0.7.3.0可能会触发分配的mplayer

插件。


因此,我不会调用SetURL()而是使用首先是'data''

属性,并尝试通过其代表属性更改该

属性的值:


document.applets [" qtvr"]。data =" sample2.mov";


另请参阅

< URL:http:// www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-9893177>

< URL:http://www.w3.org/TR/html4/ struct / objects.html#edef-OBJECT>


但是,这也是未经测试的。

虽然上面包含的示例代码包含已弃用
我必须留给别人解决的功能和错误。



document.applets["qtvr"].SetURL("sample2.mov");

should suffice. However, it is error-prone to assume that the QuickTime
plugin would always be used for displaying this object and so a SetURL()
method would be available; `param'' elements'' values need not to be
followed, the `data'' attribute is missing and the codebase is in a format
that would not be understood on non-Windows systems. Here in Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.8) Gecko/20051224 Debian/1.5.dfsg-3
Firefox/1.5 Mnenhy/0.7.3.0 that is likely to trigger the assigned mplayer
plugin instead.

Therefore, I would refrain from calling SetURL() but instead use the `data''
attribute in the first place and attempt to change the value of that
attribute via its representative property:

document.applets["qtvr"].data = "sample2.mov";

See also
<URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-9893177>
<URL:http://www.w3.org/TR/html4/struct/objects.html#edef-OBJECT>

However, that is untested as well.
Though the sample code you''ve included above contains deprecated
features and mistakes which I have to leave to someone else to fix.




< URL:http://validator.w3.org/> <无线电通信/>
PointedEars



<URL:http://validator.w3.org/>
PointedEars


Thomas''PointedEars''Lahn写道:
Thomas ''PointedEars'' Lahn wrote:
< a href ="#" onclick =" javascript :Exchange()">交换< / a>
<a href="#" onclick="javascript:Exchange()">exchange</a>



`javascript :''确实如此不属于内在的事件处理程序。相反,在`head''
元素中声明事件处理程序属性的默认脚本语言:

< meta http-equiv =" Content-Script-Type" content =" text / javascript">

应该正确取消click事件,并且应该通过脚本编写仅脚本链接:

< script type =" text / javascript">
document.write(''< a href ="#" onclick =" Exchange();''
+''返回false;">交换< \ / a>'');
< / script>



`javascript:'' does not belong into intrinsic event handlers. Declare
the default scripting language for event handler attributes in the `head''
element instead:

<meta http-equiv="Content-Script-Type" content="text/javascript">

The `click'' event should be canceled properly, and the script-only link
should be written via script:

<script type="text/javascript">
document.write(''<a href="#" onclick="Exchange();''
+ '' return false;">exchange<\/a>'');
</script>




抱歉,我不喜欢不明白为什么动态创建的代码是正确的

而直接写在页面中的相同代码是错误的?

因此,我会克制从调用SetURL()开始,而是首先使用`data''
属性,并尝试通过其代表属性更改该
属性的值:

文档。 applets [" qtvr"]。data =" sample2.mov";

另见
< URL:http://www.w3.org/TR/DOM-Level -2-HTML / html.htm l#ID-9893177>
< URL:http://www.w3.org/TR/html4/struct/objects.html#edef-OBJECT>

但是,这是未经测试。



Sorry but I don''t understand why code created dynamically is "correct"
whereas the the same code written directly in the page is "wrong"?
Therefore, I would refrain from calling SetURL() but instead use the `data''
attribute in the first place and attempt to change the value of that
attribute via its representative property:

document.applets["qtvr"].data = "sample2.mov";

See also
<URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-9893177>
<URL:http://www.w3.org/TR/html4/struct/objects.html#edef-OBJECT>

However, that is untested as well.




我测试了doc.applets,而不是使用SetURL,并且无法使用它来实现
工作。


Andrew Poulos



I tested doc.applets, as opposed to using SetURL, and couldn''t get it to
work.

Andrew Poulos


这篇关于如何使用javascript更改quicktime src?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆