• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

Playing Different Videos in FrontPage 2002

I'm NEW to FrontPage 2002.

I've added Windows Media Player to my web page fine.  No issues.

However, I would like to be able to add a list of videos with with links that will allow the user to click on one and have it play in the player on the web page.  How can I accomplish this?

Thanks,
Smithmrk
0
smithmrk
Asked:
smithmrk
  • 3
  • 2
1 Solution
 
coreybryantCommented:
>>However, I would like to be able to add a list of videos with with links that will allow the user to click on one and have it play in the player on the web page.
Did you create a page with the video on it?  

You might also take a look at this code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>Title here</title>


</head>

<body>

<p align="Center">
<script language="javascript">var streams = new Array();
streams[0] = new makeStream("one.wav", "1...Song Title One");
streams[1] = new makeStream("two.wav", "2...Song Title Two");
streams[2] = new makeStream("three.wav", "3...Song Title Three");
streams[3] = new makeStream("four.wav", "4...Song Title Four");
function makeStream(url, name) {
      this.url = url;
      this.name = name;
}
function handleControlsOnOffClick() {
  if (document.mediaPlayer.showControls == true) {
    document.mediaPlayer.showControls = false;
        document.playerCtrl.controls.value = "  :.SHOW PLAYER.:";
  }
  else {
    document.mediaPlayer.showControls = true;
        document.playerCtrl.controls.value = "  :.HIDE PLAYER.: "
  }}
function handlePlayOrPauseClick(){
  var state;
  playerStatus = document.mediaPlayer.playState;
  if (playerStatus == 6) {
    document.mediaPlayer.play();
    document.playerCtrl.playOrPause.value = " :.PAUSE.: ";
  }
  else if (playerStatus == 1) {
    document.mediaPlayer.play();
    document.playerCtrl.playOrPause.value = " :.PAUSE.: ";
  }
  else if (playerStatus == 2) {
    document.mediaPlayer.pause();
    document.playerCtrl.playOrPause.value = " :.PLAY.:  ";
  }
}
function changeSize(newSize) {
  document.mediaPlayer.displaySize = newSize;
}
function change() {
  var list = document.playerCtrl.streams;
  var streamURL = list.options[list.selectedIndex].value;
  document.mediaPlayer.stop();
  document.playerCtrl.playOrPause.value = " :.PAUSE.: ";
  document.mediaPlayer.fileName = streamURL;
}
</script>

<object id="mediaPlayer" 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" width="239" height="179">
  <param name="fileName" value="sounds/bestieverhad.wav">
  <param name="animationatStart" value="false">
  <param name="transparentatStart" value="true">
  <param name="autoStart" value="true">
  <param name="loop" value="true">
  <param name="showControls" value="false">
</object>

<form name="playerCtrl">
  <input type="button" value=" :.PAUSE.: " name="playOrPause"
  onclick="handlePlayOrPauseClick()" style="font-family:courier"> <input
  type="button" value="  :.SHOW PLAYER.: " name="controls"
  onclick="handleControlsOnOffClick()" style="font-family:courier">

<script language="javascript">
with (document) {
  writeln('<select name="streams" onChange="change()">');
  for (var i = 0; i < streams.length; i++) {
    writeln('<option value="', streams[i].url, '">', streams[i].name);
  }
  writeln('</select>');
}
</script>
</form>
</p>

</body>

</html>


And you can add your streams in this section:
<script language="javascript">var streams = new Array();
streams[0] = new makeStream("one.wav", "1...Song Title One");
streams[1] = new makeStream("two.wav", "2...Song Title Two");
streams[2] = new makeStream("three.wav", "3...Song Title Three");
streams[3] = new makeStream("four.wav", "4...Song Title Four");
function makeStream(url, name) {

-Corey
0
 
smithmrkAuthor Commented:
Corey thanks for the response, however I'm not sure about the code above.  Again I'm new to HTML and trying to learn more.

Let me try to make my question a little more clear as to what I'm trying to accomplish.

I have a web page that has the Window Media Player on it that I added (add-in) / (activeX control).  When you go through the wizard in adding it to your web page it asks you to select the videos.  When it does this it creates a playlist and will play all the videos one right after another.  What I want to do is have the Windows Media Player on the Web Page and then have a list of links below that the user can click on and have the video play in the Windows Media Player.

Example:

Baby Jumping
Dog getting Ball
Dance Contest

User clicks on Baby Jumping and the video begins to play in the Windows Media Player.  If user clicks Dog getting Ball the Baby Jumping would stop and Dog getting Ball would start playing.

Here is a line of code that was setup when I went through the wizard setup.

<param name="URL" value=".\media\mp_new_page_2_1.asx">
or
<param name="filename" VALUE="media/mp_new_page_2_1.asx">

I need to be able to change these values somehow when the user clicks on the link, so it will play that video.

I hope this help clear up what I'm trying to accomplish.  It doesn't seem like it should be this hard, but again I'm new to HTML.

Thanks,
smithmrk
0
 
coreybryantCommented:
Did you look at the code I gave you?  That is basically what it does.  

-Corey
0
 
smithmrkAuthor Commented:
Yes, I did look at your code.

I pasted it in my page, but I can't get it to work.  Like I said I'm new to this stuff.

I changed your Array to reference my files, but I can't get anything to play when I can change them.

What is this in your code = <param name="fileName" value="sounds/bestieverhad.wav">
because when I change this to one of my values it will play the video, but I don't know how I can you your array to change this value based on the selection the user makes.

Is there some way I can set a Global Variable and when the user selects a video from the drop down box you set this global variable and pass it into the "filename" value=Array[0]

Thanks,
smithmrk
0
 
coreybryantCommented:
The asker needed to probably post the code I gave in another TA.  I am not familiar enough with JS.  I answered the orginal question it seemed but the other should be in another TA - not Frontpage

-Corey
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now