Solved

multiple links that plays video in embedded windows media player when clicked

Posted on 2003-12-09
4
667 Views
Last Modified: 2010-04-06
<HTML><HEAD></HEAD>
<BODY>
<OBJECT ID='Player' width='320' height='240' CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'>
<PARAM name='autoStart' value='True'>
<PARAM name='URL' value='http://www.mydoman.com/intro.asx'>
</OBJECT>

<SCRIPT LANGUAGE='JavaScript'>
     Player.settings.setMode('loop',true);
</SCRIPT>
</BODY></HTML>

The above code is used to embed a windows media player and loop a pre-determined video clip. It works fine. However, I want many links on the page, and depending on which link is pressed, the relevant movie should be played (on the same media player). So I tried to stick all the stuff between the object tags into a javascript function in the header section of the html page like so, but I'm stuck really early on.....

<script language="JavaScript">
function playvdo()   {

document.write ("<OBJECT ID='Player' width='320' height='240'  CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'><PARAM name='autoStart' value='True'><PARAM name='URL' value='http://www.citybroadcast.tv/intro.asx'></OBJECT>");

Player.settings.setMode("loop",true);
}
</script>

and I have a link like this to call the function : <a href="javascript:playvdo()">Click Me</a>

Now, there's something wrong already. I can't get even one video clip to work, let alone having multiple choices. Can someone help? Greatly Appreciated thanks.
0
Comment
Question by:skylabel
4 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 400 total points
ID: 9909132
Add these to the body. Replace http://www.mydomain.com/movie1.asx with the URL of your movies.

<a href="#" onClick = "Player.URL = 'http://www.mydomain.com/movie1.asx';return false;">Movie 1</a>
<br>
<a href="#" onClick = "Player.URL = 'http://www.mydomain.com/movie2.asx';return false;">Movie 2</a>
<br>
<a href="#" onClick = "Player.URL = 'http://www.mydomain.com/movie3.asx';return false;">Movie 3</a>

Hope this helps.
0
 
LVL 1

Author Comment

by:skylabel
ID: 9909561
You're a genius and I'm an idiot...
works great. Thanks.
0
 

Expert Comment

by:raydess
ID: 11198469
i have a problem with this..i mean it works only when i preview it but when i save it and view it on my webpage the media players gone help?
0
 

Expert Comment

by:itortu
ID: 14987412
could you show the entire code of how to make it work? i have a similar problem and i am trying to use this code, but is not working

thanks!
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

Suggested Solutions

Title # Comments Views Activity
RSS Feed Validation 2 59
wordpress limitations 4 104
Lines Not Lining Up 2 62
Create and populate iFrame onClick of a button? 1 64
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

911 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

18 Experts available now in Live!

Get 1:1 Help Now