Solved

Embedded Windows Media Player

Posted on 2003-11-29
4
671 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thats exactly what I wanted thanks!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

743 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

11 Experts available now in Live!

Get 1:1 Help Now