Google Answers Logo
View Question
 
Q: Javascript that launches windows media player file and changes originating page ( No Answer,   4 Comments )
Question  
Subject: Javascript that launches windows media player file and changes originating page
Category: Computers > Programming
Asked by: pabloward-ga
List Price: $20.00
Posted: 25 Feb 2005 03:31 PST
Expires: 25 Feb 2005 16:22 PST
Question ID: 480600
Hi, 
I am trying to launch a windows media player file and change the page
in the window browser when a user clicks on a link in a web page.

Specifically, when the link is clicked on a web page: 
1. the window in the web browser that you are in loads a new page, and
2. windows media player plays the file.

I have learned enough about javascript in the last couple hours to do it in
a way that creates an extra window that will annoy and possibly
confuse people, but no way to do it so that the only window is the
original browser window.

This code inserted into the body of an html page, will do everything I
want but creats the extra window.

<a href="://www.google.com"
ONCLICK="window.open('mms://wm.newmediamill.speedera.net/wm.newmediamill/animate.wmv',
'NewWindow','toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=yes,width=200,height=200')">Link
      description</a>

It loads Google into the browser window that you are in and launches
the animated movie. It however also opens an unnecessary window.
Since, I only found the "window.open" function to launch the file, it
obviously creates an extra window.
	  
Ideally, this would happen from just the HREF in the HTML similarly to
the code I created above as I might now have access to the <head>
</head> area in this content management system. But, if there is no
other way to do it I am sure I will be able to find a work around to
get access to the header.

If we could close the little window automatically without a prompt to
the user, this would be ok. But, my understanding is that browsers
always asks a user if it is ok to close the window when a script
attempts to close a window.

This answer should work in most recent versions of Mozilla, Netscape and IE.

Hopefully, this is very simple. I am desperate for an answer today,
2/25, and can't think or work on it anymore.

Clarification of Question by pabloward-ga on 25 Feb 2005 12:00 PST
Thanks for the response! That only opens the audio player and start
the little movie. It doesn't allow me to refresh the web browser
window to another page.

For instance, if my example was in a blank html page and somebody
clicked on the link, it would launch the file and load Google into the
browser.  (And, unfotunately create the unnecessary window which your
script doesn't do).
Answer  
There is no answer at this time.

Comments  
Subject: Re: Javascript that launches windows media player file and changes originating p
From: jagatpreet-ga on 25 Feb 2005 11:48 PST
 
This should work fine for you.

<a href="javascript:window.location='mms://wm.newmediamill.speedera.net/wm.newmediamill/animate.wmv'">Link
description</a>
Subject: Re: Javascript that launches windows media player file and changes originating p
From: jagatpreet-ga on 25 Feb 2005 14:07 PST
 
<script>
	var redirectURL = 'http://google.com';
</script>
<a href="javascript:setTimeout('window.navigate(redirectURL)',
3000);window.location='mms://wm.newmediamill.speedera.net/wm.newmediamill/animate.wmv';">Link
description</a>

This code would work in IE. I'll see if i can find one for netscape compatibility.
Subject: Re: Javascript that launches windows media player file and changes originating p
From: jagatpreet-ga on 25 Feb 2005 14:20 PST
 
Finally, one that works on Mozilla(tested on Firefox) and ie

<script>
	var redirectURL = 'http://google.com';
</script>
<a href="mms://wm.newmediamill.speedera.net/wm.newmediamill/animate.wmv"
onclick="setTimeout('window.location = redirectURL', 2000);">Link
description</a>
Subject: Re: Javascript that launches windows media player file and changes originating p
From: pabloward-ga on 25 Feb 2005 16:22 PST
 
Thanks so much for the help!

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy