Scripting Windows Media Player

D

Dan

I have the following code:
<html>
<body>
<OBJECT id="VIDEO" width="320" height="240"
style="position:absolute; left:0;top:0;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">

<PARAM NAME="URL" VALUE="axrtsp://192.168.1.100/mpeg4/2/media.amp">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="none">
<PARAM name="PlayCount" value="9999">
</OBJECT>
<script type="text/javascript">
document.getElementById("VIDEO").play();
//also have tried document.getElementById("VIDEO").controls.play();
//also document.VIDEO.play()
</script>
</body>
</html>

The trouble is the video does not play unless I right click on it in IE
and select play from there. I am using Win Media Player 9 and IE6. This
is a live MPEG4 stream, I don't know if it has anything to do with the
trouble or not. The point is why does, a right click / play menu
selection work and not a document....play(). Dan
 
R

Randy Webb

Dan said the following on 5/22/2006 4:59 PM:
I have the following code:
<html>
<body>
<OBJECT id="VIDEO" width="320" height="240"
style="position:absolute; left:0;top:0;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">

<PARAM NAME="URL" VALUE="axrtsp://192.168.1.100/mpeg4/2/media.amp">

What protocol is axrtsp: ??
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="none">
<PARAM name="PlayCount" value="9999">
</OBJECT>
<script type="text/javascript">
document.getElementById("VIDEO").play();
//also have tried document.getElementById("VIDEO").controls.play();
//also document.VIDEO.play()
</script>
</body>
</html>

The trouble is the video does not play unless I right click on it in IE
and select play from there.

You should be able to click twice with the left mouse button and get it
to play.
I am using Win Media Player 9 and IE6. This is a live MPEG4 stream,
I don't know if it has anything to do with the trouble or not.

The trouble is MS and EOLAS.
The point is why does, a right click / play menu
selection work and not a document....play().

Because script can't instantiate an ActiveX object anymore that is hard
coded into the page or dynamically created within the page. If it is
created using document.write from an external file, then it becomes
instantiated and you can script it.
 
J

JimK

Dan said the following on 5/22/2006 4:59 PM:

What protocol is axrtsp: ??


You should be able to click twice with the left mouse button and get it
to play.


The trouble is MS and EOLAS.


Because script can't instantiate an ActiveX object anymore that is hard
coded into the page or dynamically created within the page. If it is
created using document.write from an external file, then it becomes
instantiated and you can script it.




On April 11th, 2006 Due to the Loss of the Eolas Embedded External
Object Patent Lawsuit Microsoft is Forced to Update Internet Explorer
and by Default Disable Your Audio Players, Video Players, Flash
Banners, Java Applets, and Flash Menus Unless You Have What We are
Affectionately Calling "The Fix."
http://www.fastobjectfix.com/
 
D

Dan

What protocol is axrtsp: ??
I think it is a custom rtsp protocol for my axis video camera server
that I am accessing. I just put what the example showed for the server.
Because script can't instantiate an ActiveX object anymore that is hard
coded into the page or dynamically created within the page. If it is
created using document.write from an external file, then it becomes
instantiated and you can script it.
Im not sure what your getting at, I am a recent user of Javascript.
How do I accomplish what you suggest?
 
J

JimK

Im not sure what your getting at, I am a recent user of Javascript.
How do I accomplish what you suggest?


Replace <OBJECT ...... </OBJECT> with

<script language='JavaScript' src='script.js'
type='text/javascript'></script>


then

save below as script.js

document.write('<OBJECT id="VIDEO" width="320" height="240"
style="position:absolute; left:0;top:0;" ');
document.write('CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject"> ');
document.write('<PARAM NAME="URL"
VALUE="axrtsp://192.168.1.100/mpeg4/2/media.amp"> ');
document.write('<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
');
document.write('<PARAM NAME="AutoStart" VALUE="True"> ');
document.write('<PARAM name="uiMode" value="none"> ');
document.write('<PARAM name="PlayCount" value="9999"> ');
document.write('<OBJECT id="VIDEO" width="320" height="240" style="position:absolute; left:0;top:0;" ');
document.write('CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> ');
document.write('<PARAM NAME="URL" VALUE="axrtsp://192.168.1.100/mpeg4/2/media.amp"> ');
document.write('<PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> ');
document.write('<PARAM NAME="AutoStart" VALUE="True"> ');
document.write('<PARAM name="uiMode" value="none"> ');
document.write('<PARAM name="PlayCount" value="9999"> ');
document.write('</OBJECT>');


(unwrap the text so its
document.write(
document.write(
document.write(
document.write(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top