Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: send values to media elements

  1. #1
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default send values to media elements

    sending a value to a media player.

    if you have the media player in your page windows media player or quicktime.

    to send a value from a link put in a variable; how do you send it in a cross browser script to the embed src and the object tags param. I have read that there are problems with send things to param

    do you need to use :
    function{
    var newValue= link1.herf or link1.valuenew

    O.newP.value=newValue
    or
    newP.value=newValue

    and for the embed element is it: newO.newE.value=newValue or

    newO.newE.src=newValue
    or
    newE.value=newValue
    or
    newE.src=newValue


    <body>
    <a id="link1" herf="" retuen false>click here</a>
    <object id="newO"
    <param id="newP" name="" value=""/>
    <embed id="newE" src=""/>
    </object>

  2. #2
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    if you are confused just ask me what I mean?

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Okay... What do you mean? I think you're talking about change param attributes?
    - Mike

  4. #4
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    yeah I want to send a value to them; a value from a link but I don't know who to do it. I also want to send the vaule of the link to the src of the embed tag.

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Use this to access it:
    Code:
    document.embeds["newE"]
    and if you want to change an attribute:
    Code:
    document.embeds["newE"]["src"] = "new source";
    - Mike

  6. #6
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    okay thanks but if I wanted to get to the param element of the object tag. what do I do.

    also do you get the href value by going var nelo= link.href

    and I'm having a bit of trouble with return false on links; it never seems to work.
    Last edited by riptide; 06-03-2007 at 06:18 PM.

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    The object tag is not an attribute of the param tag... I think you are getting something confused here. Could you explain a bit more?
    - Mike

  8. #8
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    like if I have
    <object id="Player" width="300" height="450"
    classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
    standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
    <param name="fileName" value="">
    </object>>
    I'm trying to send a value from a link to the param's value.

    someone said to just use Player.filename=newvalue
    but I don't understand how to get the links href value the right way.

  9. #9
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Check which number the param number is on the page starting at zero and use the following:
    Code:
    document.getElementsByTagName("param")[0].value = "NEW VALUE"
    I'm not sure if JS is allowed to access flash objects though.
    - Mike

  10. #10
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    I'm not going to use flash. can you add an ID to the param to get it easier.

Bookmarks

Posting Permissions

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