Solved

Embedded Windows Media Player

Posted on 2003-11-29
4
681 Views
Last Modified: 2010-04-06
Hello. I have set up Windows 2003 Server with Windows Media Services enabled. I recently set it up so I could stream video from my computer also. What I would like to do is create a webpage with links to those videos but when you click a link it will open a small window with an embedded windows media player in it that will play the video. If you click another link it will open up that same window and play that different video. Similar to launch.yahoo.com but something very simple would work. I would like for this to be a simple html page or asp page because I run IIS on this server as well. Does anybody know how I could do this? Sorry I couldnt put more points up but I used just about all I had. Thank you for your time.
0
Comment
Question by:molard
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 125 total points
ID: 9844567
Here is a complete document:

<html>
<head>
<script language="JavaScript" type="text/javascript">
function video(url)
{
      a = window.open("#","win1","height=300,width=400")
      a.document.open()
      output = "<center><embed src = \"" + url + "\""
      output += " autostart=true"
      output += "></center>"
      a.document.write(output)
      a.document.close()
}
</script>
</head>
<body>
<a href="#" onClick="video('http://www.microsoft.com/office/greatmoments/asx/water_300.asx')">Great Moments: Water</a>
<br>
<a href="#" onClick="video('http://www.microsoft.com/office/greatmoments/asx/screen_300.asx')">Great Moments: Screen</a>
</body>
</html>

You can add links like this:
<a href="#" onClick="video('path_to_your_file.asx')">Click here for my movie</a>
0
 

Author Comment

by:molard
ID: 9844649
You are awesome thanks! I will award you the points. One other question though. Is there a way that when I click on that link it will put the title of that video at the top of that window that pops up with the media player. Like for example I click Great Moments: Water. The window with the media player pops up. Can I set it up so that Great Moments: Water will display right above the player? And If i click Great Moments: Screen that title will also? Thank you again.
0
 
LVL 15

Expert Comment

by:Timbo87
ID: 9844660
Yes you can, but you can't really extract it from the link. It would require an extra parameter in the video() function like this.

<html>
<head>
<script language="JavaScript" type="text/javascript">
function video(url,title)
{
      a = window.open("#","win1","height=315,width=400")
      a.document.open()
      output = "<title>" + title + "</title><center>"
      output += title + "<br>"
      output += "<embed src = \"" + url + "\""
      output += " autostart=true"
      output += "></center>"
      a.document.write(output)
      a.document.close()
}
</script>
</head>
<body>
<a href="#" onClick="video('http://www.microsoft.com/office/greatmoments/asx/water_300.asx','Great Moments: Water')">Great Moments: Water</a>
<br>
<a href="#" onClick="video('http://www.microsoft.com/office/greatmoments/asx/screen_300.asx','Great Moments: Screen')">Great Moments: Screen</a>
</body>
</html>

So you would now link it like this:
<a href="#" onClick="video('path_to_your_file.asx','My Title')">Click here for my movie</a>
0
 

Author Comment

by:molard
ID: 9844668
Thats exactly what I wanted thanks!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to dynamically load/unload User control in ASP.net page? 2 180
Technology stack suggestions 4 63
ColdFusion Rereplace 3 80
API Soap Calls 4 116
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

777 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