Re: control time / length of video
- From: "Neil Smith [MVP Digital Media]" <neil@xxxxxxxxxx>
- Date: Thu, 18 May 2006 19:38:23 GMT
Hint : You probably wanted to start a new thread, rather than
hijacking this one.
There's no method MediaPlayer.next() method. There *is* a
MediaPlayer.Controls.next() and MediaPlayer.Controls.previous() method
available.
However, none of the scripting controls work properly in Firefox (even
if you'd referenced the player properly, which you didn't). The DOM
for your HTML page doesn't by deafult declare 'MediaPlayer' as a
global object available within the page, it's accidental (and a bug)
that IE does so.
I can't see why you could think that the player would automatically
play even if a URL is passed to it. The player needs to be told to do
Controls.play() after a URL is loaded - or you'd have to set the
<param name="autostart" value="true" /> in the OBJECT element used by
IE, and I think really you no longer need to consider using EMBED tags
as long as you form your OBJECT element correctly.
To do that, you'd set an atttibute type="video/x-ms-asf" in the
object, as well as providing a data="dummy.asx" element so that FF and
Netscape knew what sort of data to use with the object. They can't
tell that from the CLASSID value because that's IE only attribute.
Have a look at the Netscape documentation for this as a start :
http://developer.mozilla.org/en/docs/Windows_Media_in_Netscape#Example_2:_Use_of_OBJECT_Element_to_Create_Control
There's also some slightlly less up to date code in the WM SDK :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/usingtheplayercontrolinawebpage.asp
HTH
Cheers - Neil
On 18 May 2006 11:29:59 -0700, "Ron" <rlubin1@xxxxxxxxx> wrote:
Hi Neil,------------------------------------------------
Maybe you can help me with my problem.
I have an embeded windows media player on my webpage to play a
playlist.
As expected everything works great in IE but I can't get the Player nor
the custom controls to work in FireFox. Can you help Please.
---For the embeded player---
<OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=40
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
STANDBY="Loading Windows Media Player components..."
TYPE="application/x-oleobject">
<EMBED TYPE="application/x-mplayer2"
NAME="MediaPlayer"
WIDTH=320
HEIGHT=40>
</EMBED>
<% IF instr(Request.ServerVariables("HTTP_USER_AGENT"), "MSIE") then
Response.Write("Internet Explorer") %>
<SCRIPT language="JScript">
<!--
{
MediaPlayer.URL = "playlist.asx";
}
function next ()
{
MediaPlayer.controls.next();
}
function previous ()
{
MediaPlayer.controls.previous();
}
-->
</script>
<FORM>
<INPUT TYPE=BUTTON
NAME="ForwardButton"
VALUE="Next"
ONCLICK="next()">
<INPUT TYPE=BUTTON
NAME="ReverseButton"
VALUE="Previous"
ONCLICK="previous()">
</FORM>
<%else if instr(Request.ServerVariables("HTTP_USER_AGENT"), "Firefox")
then
Response.Write("Firefox<br>") %>
<SCRIPT language="JScript">
<!--
{
MediaPlayer.URL = "playlist.asx";
}
function next ()
{
MediaPlayer.next();
}
function previous ()
{
MediaPlayer.previous();
}
-->
</script>
<FORM>
<INPUT TYPE=BUTTON
NAME="ForwardButton"
VALUE="Next"
ONCLICK="next()">
<INPUT TYPE=BUTTON
NAME="ReverseButton"
VALUE="Previous"
ONCLICK="previous()">
</FORM>
<%
end if
end if %>
As you can see, the page should launch the playlis.asx to start playing
automatically but that does not work in FF. I've tried to code the
page to detect what type of browser I am using which works but not the
jscript for the controls in FF.
If you can please help me.
Digital Media MVP : 2004-2006
http://mvp.support.microsoft.com/mvpfaqs
.
- Follow-Ups:
- Re: control time / length of video
- From: Ron
- Re: control time / length of video
- References:
- Re: control time / length of video
- From: Neil Smith [MVP Digital Media]
- Re: control time / length of video
- From: Ron
- Re: control time / length of video
- Prev by Date: Re: control time / length of video
- Next by Date: Re: control time / length of video
- Previous by thread: Re: control time / length of video
- Next by thread: Re: control time / length of video
- Index(es):