Results 1 to 2 of 2

Thread: A little help with using JavaScript to control an embedded media player

  1. #1
    Join Date
    Sep 2008
    Posts
    3

    A little help with using JavaScript to control an embedded media player

    A little help with using JavaScript to control an embedded media player

    I guess I'll just lay out what I have so far.


    This code should insert HTML inside the span ID 'Song' tags. The reason it says : "innerHTML = play;", is that 'play' is a variable that's saved within the songvars.js file, which can be viewed at the bottom of this post.
    Code:
    <script  src="songvars.js" type="text/javascript">
    function update(){
    document.getElementById('Song').innerHTML = play;
    }
    </script>

    This is the button that when pressed, will activate the function 'update' and replace the HTML within the 'span' tags.
    Code:
    <a href="javascript:;" onclick='update()'>Another Rainy Day</a>

    This is the span. As you can see, there is no HTML inside of it.
    Code:
    <span id="Song"></span>


    This is the 'songvar.js' file. As you can see, var 'play' = MediaPlayer1, and MediaPlayer1 is the object within the file.
    Code:
    var play=MediaPlayer1
    <object id="MediaPlayer1"
    classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
    data="123456" 
    type="application/x-oleobject" 
    width=380 
    height=50 
    align="middle" 
    standby="Loading Microsoft&reg; Windows&reg; Media Player components...">
    
    <param name="FileName" value="ANOTHERRAINYDAY.mp3">
    <param name="AutoStart" value=CurrentSong>
    <param name="ShowStatusBar" value="True">
    <param name="DefaultFrame" value="mainFrame">
    <param name="PlayList" value="Enable">
    </object>


    In my mind, this is how it should work:

    user clicks on Another Rainy Day button, the button triggers the JavaScript function "update". Update then replaces the html within the span tags ID'd 'Song', with the variable 'play', which within the songvars.js file, variable 'play' should be read as MediaPlayer1, because I have a line of code within the songvares.js file that says play=MediaPlayer1.


    Any help is much appreciated.
    The script when finished, will load the media player when the button is pressed. The reason I need this code, is so when a user clicks a song name from my song list, it will load a player with that song name embedded.

    I tried just wrapping span tags around the param filename="ALONEINSHAME" tag, and having the update function change the innerHTML to a different song name, but I still get the same result.

    What result do I get???

    Nothing happens, and I get the little error icon in the bottom corner of the screen.


    Thanks!

    -Vnnie

  2. #2
    Join Date
    Sep 2008
    Posts
    1

    Is this a true bayonet?

    Has anyone ever seen this knife before and can it really be used on a bayonet? It is said that it can fit together with a AK47 rifle. Maybe it is a copy of some old military knife that was used back in one of the wars? The website that it is on is www.lducompany.com I am wondering if it can fit on any other types of guns or rifles. Does it look like something that would be used by Chinese, Koreans, or Russians. Here is a link to the knives page http://www.liangdianup.com/knives_1.htm and it is the knife with the number 406023 right at the top of the page.Any help would be appreciated before I order it all the way from China

Similar Threads

  1. Audio Site (embedded player help)
    By DISK in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 04 Nov 2006, 06:31 PM
  2. Embedded Windows Media PLayer
    By slegendre in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 22 Sep 2005, 08:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •