Jump to content

mp3 plays when testing locally, downloads on site


mgason

Recommended Posts

Hi,I have some mp3's on a page. I do not really want to embed a player in the page but I want people to be able to stop the audio.So I open a new window from a link and let the browser launch a helper app.This works fine locally but when I test it online the new window launches and the mp3 downloads instead of playing.I use a simple javascript to launch and size the new window, I have included it but do not think it is the problem.I have a page here for testing, all of the links point to the same mp3 file at the moment. http://museum.spps.org/pop_up_audio.htmlTo launch the window and play the mp3

<a href="uploads/2ndGraders.mp3" onclick="wopen('uploads/2ndGraders.mp3', 'popup', 350, 150); return false;" target="popup">2nd Graders talk about Museum Magnet</a>

this is the javascript for launching the new browser window

<script><!--function wopen(url, name, w, h){// Fudge factors for window decoration space. // In my tests these work well on all platforms & browsers.w += 32;h += 96; var win = window.open(url,  name,   'width=' + w + ', height=' + h + ', ' +  'location=no, menubar=no, ' +  'status=no, toolbar=no, scrollbars=no, resizable=no'); win.resizeTo(w, h); win.focus();}// --></script>

Link to comment
Share on other sites

Change of plan!! Well 2nd plan that might work. Solution to this or the one above would be finehttp://museum.spps.org/audio_testing.htmlUsing this script

<script>function EvalSound(soundobj) {  var thissound=document.getElementById(soundobj);  thissound.Play();}function EndSound(soundobj) {  var thissound=document.getElementById(soundobj);  thissound.Stop();}</script>

embedding my sounds like this

<embed src="2ndGraders.mp3" autostart=false width=0 height=0 id="sound1"enablejavascript="true"></embed>

then starting and stopping the sound like this with image buttons

<div class="audio-list"><INPUT TYPE="image" SRC="images/microphone-icon-64.jpg"ALT="PLay Sound" NAME="Play sound" onClick="EvalSound('sound1')"><INPUT TYPE="image" SRC="images/microphone-icon-64.jpg"ALT="Stop Sound" NAME="Stop Sound"  onClick="EndSound('sound1')">2nd Graders talk about Museum Magnet</div>

I get something that works pretty well by changing to playing the audio in the page and supplying controls. 3 issues though.1. Audio plays for a second after you click then stops, click fast and furious and it keeps going. This does not happen when testing locally.2.How can I have the microphone image be a sprite with 2 states that swap when it is clicked?3.How can I get the text to be aligned with the middle of the microphone image?thanksMark

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...