Solved

Another windows media player q - check for video end

Posted on 2004-10-14
4
271 Views
Last Modified: 2008-01-16
This is the code that is in an html page that I inherited.  It takes a video created in ms producer for powerpoint 2003 and plays it in media player.

            <!-- ---------------- MEDIA PLAYER  --------------------------------- -->
            <div id=LeftSideBackground style="position:absolute;display:none;WMPrerollDisplay:none">
                  <div id=MediaPlayerDiv>

<SCRIPT LANGUAGE="JavaScript">             
<!--
if (ClientCaps & Browser_SupportsNavigateCSS)
      MediaPlayer_Create();
-->
</SCRIPT>                  
                        <div id=MediaPlayerControlsDiv style="position:relative">
                              <!-- MediaPlayer buttons -->

                              <div id=PlayerBL class=PlayerBL></div>
                              <div id=PlayerBC class=PlayerBC></div>
                              <div id=PlayerBR class=PlayerBR></div>
                              <a id=PlayerPlayPause OnMouseOver="MediaPlayer_ButtonRollOver(this)"; OnMouseOut="MediaPlayer_ButtonRollOut(this)"; OnMouseDown="MediaPlayer_OnMouseDown(this)" OnMouseUp="MediaPlayer_OnMouseUp(this)" OnKeyDown="MediaPlayer_OnMouseDown(this)" OnKeyUp="MediaPlayer_OnMouseUp(this)" TABINDEX=2 ></a>
                              <a id=PlayerPrevious OnMouseOver="MediaPlayer_ButtonRollOver(this)"; OnMouseOut="MediaPlayer_ButtonRollOut(this)"; OnMouseDown="MediaPlayer_OnMouseDown(this)" OnMouseUp="MediaPlayer_OnMouseUp(this)" OnKeyDown="MediaPlayer_OnMouseDown(this)" OnKeyUp="MediaPlayer_OnMouseUp(this)" TABINDEX=2 WMEnabled=0></a>
                              <a id=PlayerNext OnMouseOver="MediaPlayer_ButtonRollOver(this)"; OnMouseOut="MediaPlayer_ButtonRollOut(this)"; OnMouseDown="MediaPlayer_OnMouseDown(this)" OnMouseUp="MediaPlayer_OnMouseUp(this)" OnKeyDown="MediaPlayer_OnMouseDown(this)" OnKeyUp="MediaPlayer_OnMouseUp(this)" TABINDEX=2 WMEnabled=0></a>
                              <a id=PlayerDiscussion style="visibility:hidden" OnMouseOver="MediaPlayer_ButtonRollOver(this)"; OnMouseOut="MediaPlayer_ButtonRollOut(this)"; OnMouseDown="MediaPlayer_OnMouseDown(this)" OnMouseUp="MediaPlayer_OnMouseUp(this)" OnKeyDown="MediaPlayer_OnMouseDown(this)" OnKeyUp="MediaPlayer_OnMouseUp(this)" TABINDEX=2></a>
                              <a id=PlayerSkipBack OnMouseOver="MediaPlayer_ButtonRollOver(this)"; OnMouseOut="MediaPlayer_ButtonRollOut(this)"; OnMouseDown="MediaPlayer_OnMouseDown(this)" OnMouseUp="MediaPlayer_OnMouseUp(this)" OnKeyDown="MediaPlayer_OnMouseDown(this)" OnKeyUp="MediaPlayer_OnMouseUp(this)" TABINDEX=2 WMEnabled=0></a>
                              <a id=PlayerSkipForward OnMouseOver="MediaPlayer_ButtonRollOver(this)"; OnMouseOut="MediaPlayer_ButtonRollOut(this)"; OnMouseDown="MediaPlayer_OnMouseDown(this)" OnMouseUp="MediaPlayer_OnMouseUp(this)" OnKeyDown="MediaPlayer_OnMouseDown(this)" OnKeyUp="MediaPlayer_OnMouseUp(this)" TABINDEX=2 WMEnabled=0></a>
                              <a id=PlayerVolume OnMouseOver="MediaPlayer_ButtonRollOver(this)"; OnMouseOut="MediaPlayer_ButtonRollOut(this)"; OnMouseDown="MediaPlayer_OnMouseDown(this)" OnMouseUp="MediaPlayer_OnMouseUp(this)" OnKeyDown="MediaPlayer_OnMouseDown(this)" OnKeyUp="MediaPlayer_OnMouseUp(this)" TABINDEX=2 WMEnabled=0></a>
                              <div id=PlayerClock NOWRAP style="visibility:hidden"></div>
                        </div>
                  </div>





I want to be able to tell when the movie ends and write some javascript to do something at that point.

Thanks!
0
Comment
Question by:JGoyer
  • 2
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
OliWarner earned 500 total points
ID: 12308543
If you knew how long the video was, you could use a timer to load a function...
0
 
LVL 2

Author Comment

by:JGoyer
ID: 12308763
Great idea.  Except there are going to be lots of different videos added by a non-techie who probably will not have a clue on the duration.  That would be an excellent way of handling it....If only ;-)
0
 
LVL 16

Expert Comment

by:OliWarner
ID: 12309011
hmm

The only other way I can think of doing it is writing your own flash thing that loads up the video and tells the page to execute some JS when its done... that would work.

http://www.cbtcafe.com/flash/loadmovie/loadmovie.html
0
 
LVL 2

Author Comment

by:JGoyer
ID: 12393785
Thanks for your time Oli!  Your solutions will definitely work for what I am doing.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now