TheDesignspace
Seeking to Specific points in a Windows Media player file


March 03, 2004
Video and Multimedia

I have had trouble getting Windows Media Player to consistently seek to markers embedded in the video itself, but it does seem to seek to specific timings. Some sample code is provided below:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Seeking to Specific Points in a Windows Media File</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</HEAD>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">


<P align="center"><BR>
    <BR>
    <BR>
    <OBJECT id='mediaPlayer2' 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='markers.asx'>
        <PARAM name='autoStart' value='1'>
        <PARAM name='ShowControls' value='true'>
        <PARAM name='EnableContextMenu' value='true'>
        <PARAM name='EnableMarkerCount' value='true'>
        <PARAM name='ShowGoToBar' value='true'>
        <PARAM name='ShowStatusBar' value='true'>
        <PARAM name='ShowTracker' value='true'>
        <EMBED  
          src="markers.asx"  
          width="300"  
          height="290"  
          enablemarkercount="1"
          enablecontextmenu="1" 
          enablefullscreencontrols="1" 
          enabletracker="1"  
          showcontrols="1"  
          showaudiocontrols="1"  
          showdisplay="1"  
          showgotobar="1"  
          showpositioncontrols="1"  
          showstatusbar="1"  
          showtracker="1"
		   allowchangedisplaysize="0" autorewind="0" balance="0" bufferingtime="3" filename="video.asx" videobordercolor="1" videoborderwidth="1" volume="-500"  > 
        </EMBED> </OBJECT>
    <BR>
    <BR>
    <A href='javascript;'onClick='javascript:mediaPlayer2.CurrentPosition=149; return false'>Jump 
    to 2</A> <BR>
    <A href='javascript;'onClick='javascript:mediaPlayer2.CurrentPosition=268; return false'>Jump 
    to 3</A> <BR>
    <A href='javascript;'onClick='javascript:mediaPlayer2.CurrentPosition=396; return false'>Jump 
    to 4 </A> </P>
</BODY>
</HTML> 
Posted by ellen at March 03, 2004 12:53 PM | TrackBack

 Comments

Ellen,

THANKS!!!

Your script is exactly what was needed!!

Posted by: peter on June 9, 2004 5:45 PM

Ellen,

my thanks were a bit premature. Our application places the video and links in one frame and target images in the other. Your example works great for just jumping to specific times within a single frame.

Maybe i can figure out how to tweak it a little?

Best regards.

Posted by: peter on June 9, 2004 6:01 PM

A good source of info about scripting within frames is here
http://www.yourhtmlsource.com/javascript/scriptingframes.html

Posted by: Ellen on June 9, 2004 8:28 PM
 Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?



Recommended Reading