EMBED element - dynamically changing SRC attribute

Discussion in 'HTML' started by Martin, Dec 15, 2003.

  1. Martin

    Martin Guest

    Hi,

    Does anyone know how to dynamically (client side) change the source for an
    embedded object? I am offering a list with media files (mpg, wav) and I want
    the file the user selects to be played in the embedded media player. What
    happens is that only the initially set media file (in the SRC attribute of
    the EMBED element) is played. Onwards it doesn't matter what I assign to the
    SRC attribute, only the initial file will play.

    I use the OnChange event of the SELECT element to trigger a function that
    sets the SRC attribute of the EMBED element. This seems to work as an alert
    shows but it doesn't reach the Media Player. Should I kick the EMBED element
    somehow?

    Martin.
     
    Martin, Dec 15, 2003
    #1
    1. Advertising

  2. Martin

    Whitecrest Guest

    In article <3fde1995$0$43994$4all.nl>,
    says...
    > Does anyone know how to dynamically (client side) change the source for an
    > embedded object?....


    Depends on the embedded object. If it is Microsoft Media player, then
    you use javascript to change the Filename property. If autostart was
    set to true, then it will change.

    --
    Whitecrest Entertainment
    www.whitecrestent.com
     
    Whitecrest, Dec 16, 2003
    #2
    1. Advertising

  3. Martin

    Martin Guest

    > > Does anyone know how to dynamically (client side) change the source for
    an
    > > embedded object?....


    > Depends on the embedded object. If it is Microsoft Media player, then
    > you use javascript to change the Filename property. If autostart was
    > set to true, then it will change.


    It works. Pfew! That simple?! Thanks a lot, this was driving me nuts.
     
    Martin, Dec 16, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Richter

    <txt src= ...> equivalent of <img src= ...>

    Steve Richter, Feb 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,179
    Laurent Bugnion
    Feb 9, 2006
  2. Greg Johnson
    Replies:
    4
    Views:
    3,140
  3. Peter Stickney

    Javascript Changing SRC of EMBED Quicktime

    Peter Stickney, Feb 14, 2005, in forum: Javascript
    Replies:
    0
    Views:
    139
    Peter Stickney
    Feb 14, 2005
  4. DoomedLung

    changing xml src element

    DoomedLung, Jul 28, 2005, in forum: Javascript
    Replies:
    0
    Views:
    86
    DoomedLung
    Jul 28, 2005
  5. JavaScriptJon

    Changing the src of an embed

    JavaScriptJon, Dec 4, 2005, in forum: Javascript
    Replies:
    1
    Views:
    74
    Randy Webb
    Dec 4, 2005
Loading...

Share This Page