Embedding Multiple Media Players on the same page

  • cjd
  • Born
  • Born
  • cjd
  • Posts: 2

Post 3+ Months Ago

I am trying to embed many media players on the same page as a pronunciation facility, as it is a language website. I would like to have the actual media player hidden and instead have a button with "Pronounce".
Currently I can only make one media player work per page; the code I am using is:

<OBJECT ID="Player" height="0" width="0"
<INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="Pronounce" OnClick="StartMeUp()">

function StartMeUp ()
Player.URL = "myfile.mp3";


This code works for me with one media player but when I duplicate it it stops any of the media players working. I was thinking I might need some sort of asx file but I'm not sure how they work.

Can anyone help me?
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1825
  • Loc: In the Great White North

Post 3+ Months Ago

The object ID needs to be unique for each instance. Also the unique ID and the line "target" inside startMeUp need to match. Then the function name In this case "StartMeUp" needs to be unique and match the function in the script

ID="Player1" OnClick="StartMeUp1"
ID="Player2" OnClick="StartMeUp2"
etc and
Code: [ Select ]
function StartMeUp1 ()
Player1.URL = "urlForPlayer1.mpg";
function StartMeUp2 ()
Player2.URL = "urlForPlayer2.mpg";
  1. function StartMeUp1 ()
  2. {
  3. Player1.URL = "urlForPlayer1.mpg";
  4. }
  6. function StartMeUp2 ()
  7. {
  8. Player2.URL = "urlForPlayer2.mpg";
  9. }
  • cjd
  • Born
  • Born
  • cjd
  • Posts: 2

Post 3+ Months Ago

Thanks, that solved it, I knew it was going to be something simple enough, you're a life saver!
  • spork
  • Brewmaster
  • Silver Member
  • spork
  • Posts: 6296
  • Loc: Seattle, WA

Post 3+ Months Ago

Also, cjd, for the record, it would be a good idea to get into the habit of using all lowercase HTML tags.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.