Need Help with this script

D

Dick

Here is the web address of a page I made (with lots of help from Charles) to
allow the viewer to select the video to play in the embeded WMP. It works OK,
but is there a way to modify it so the movie player is invisable and the
background shows, until the choice is clicked? http://www.fumcwl.org/THE
MEDIA ROOM.htm

Thanks to all
 
C

Charles Ezzell \(MSFT\)

Dick,

change:
<param name="uiMode" value="full">
to
<param name="uiMode" value="invisible">

That will make the player invisible when the page is loaded.
then, in the functions to "start" the movies, add this line before the
"play" command:
WindowsMediaPlayer1.uiMode = "Full";

This will make the player visible.

Now, if you want the player to go back invisible when it's done with the
movie, you have to add an event script which gets a tad more complicated
<G>. If you add the below in the body section of your page, it will make the
player invisible when it is done. You could strip out all the case
statements except case 8 if you want. I usually keep everything in just in
case I want to add/change something.

<script type="text/javascript" for="WindowsMediaPlayer1"
event="playStateChange(NewState)">
// Test for the player current state, display a message for each.
switch (NewState){
// stopped
case 1:
break;

// paused
case 2:
break;

// playing
case 3:
break;

// fast forward
case 4:
break;

// fast rewind
case 5:
break;

// buffering
case 6:
break;

// waiting - connection established, but server not sending data.
Waiting for session to begin
case 7:
break;

// end - media ended, media item has completed playback
case 8:
WindowsMediaPlayer1.uiMode = "Invisible";
break;

// transitioning - preparing new media item
case 9:
break;

// ready to begin playing
case 10:
break;

// reconnecting to stream
case 11:
break;

// Other cases go here.
default:

}
</script>



Charles
 
D

Dick

Charles, to use the vernacular, you are the man! Oh how I wish I had the
knowlage of Javascript you have. It is very kind of you to share your
expertise with us. Your suggestions worked fine, I am slowly becoming able
to figure out where the various code elements should be placed. Thanks again.

Dick
 

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

Top