Loading ...
Sorry, an error occurred while loading the content.
 

Re: SVG 1.2 Audio and Events

Expand Messages
  • Jeff Schiller
    Thanks Bjoern! ... smil::ElementTimeControl
    Message 1 of 3 , Dec 20 1:22 PM
      Thanks Bjoern!

      --- In svg-developers@yahoogroups.com, Bjoern Hoehrmann
      <derhoermi@g...> wrote:
      >
      > * Jeff Schiller wrote:
      > >The media01.svg example given in
      >
      >http://www.w3.org/TR/2005/WD-SVGMobile12-20051207/multimedia.html#AudioElement
      > >shows how to do this for a specific button, but the audio element
      > >specifically targets a specific button. So I don't think I can use
      > >this simple method.
      >
      > You can use a list in the begin attribute, maybe
      >
      > <audio begin="foo.click; bar.click; baz.click; ..."
      >
      > will do it for you.
      >
      > >- an <audio> element is considered a "Timed Event":
      >
      >http://www.w3.org/TR/2005/WD-SVGMobile12-20051207/intro.html#TermTimedElement
      > >- a Timed Event implements the SVGAnimationElement interface:
      > >http://www.w3.org/TR/2005/WD-SVGMobile12-20051207/svgudom.html
      > >- the SVGAnimationElement interface extends the
      smil::ElementTimeControl
      > >- the smil::ElementTimeControl has the beginElement() method
      >
      > s/Timed Event/Timed Element/ but yes.
      >
      > >So I guess I could do this:
      > >
      > > <audio xml:id="audioClip1" .../>
      > >
      > > <handler xml:id="buttonClicker" type="application/ecmascript"
      > >ev:event="ev:click">
      > > var myAnimationElement = document.getElementById("audioClip1");
      > > myAnimationElement.beginElement();
      > > </handler>
      >
      > Note that this would register a listener on the parent of the handler
      > element, if that's not one of your buttons this is not what you want,
      > you should remove the ev:event attribute.
      >
      > >And then a bunch of these:
      > >
      > > <ev:listener event="ev:click" observer="#button1"
      > > handler="#buttonClicker"/>
      > > <ev:listener event="ev:click" observer="#button2"
      > > handler="#buttonClicker"/>
      > > <ev:listener event="ev:click" observer="#button3"
      > > handler="#buttonClicker"/>
      >
      > Yes.
      > --
      > Björn Höhrmann · mailto:bjoern@h... · http://bjoern.hoehrmann.de
      > Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
      > 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.