W3C home > Mailing lists > Public > www-smil@w3.org > April to June 2003

FW: SMIL and Javascript

From: Patrick Schmitz <cogit@ludicrum.org>
Date: Fri, 11 Apr 2003 10:43:12 -0700
To: <www-smil@w3.org>
Message-ID: <ENEGINNFOHPGHPIICCFJMELMCPAA.cogit@ludicrum.org>

For some reason, I have fallen off this list (again), or I would have
addressed this directly.

Here you go (at least for IE, where SMIL + script is possible). Not sure
whether there is some similar approach in SMIL Language Profile (Real,
Oratrix, et al.).

Patrick

-----Original Message-----
From: Patrick Schmitz [mailto:cogit@ludicrum.org]
Sent: Friday, April 11, 2003 9:21 AM
To: J.R. van Ossenbruggen
Subject: RE: SMIL and Javascript


I do this all the time, but not directly as coded.  I just put in a dummy
element with timing and then call script on the begin event. This does what
I need in all the cases I have seen. Since the timing must behave even if
the element is otherwise garbage, you are all set:

<ref begin="whatever you want" onbegin="callScript()"
  onend="foo='bar'; bar.backgroundColor='red';window.status='My script was
called';" />

The XHTML+SMIL profile dithered about actually placing timing on inline
script elements, mostly because of the confusion of parsing and execution
issues.  Since the workaround is so straight-forward, IE decided to bail on
that one and ignore timing on actual script elements.

Would this address the issue?

Patrick

> -----Original Message-----
> From: J.R. van Ossenbruggen [mailto:Jacco.van.Ossenbruggen@cwi.nl]
> Sent: Friday, April 11, 2003 1:50 AM
> To: cogit@ludicrum.org
> Subject: Re: SMIL and Javascript
>
>
>
> Hi Patrick,
>
> do you know to what extent IE can schedule javascript in HTML+TIME?
>
> Thanks, Jacco
>
> >From www-smil@w3.org list:
>
> On Fri, Apr 11 2003 Ryan Henderson wrote:
> > On 10/4/03 8:15 PM, "J.R. van Ossenbruggen"
> <Jacco.van.Ossenbruggen@cwi.nl>
> > wrote:
> >
> > > On Fri, Apr 4 2003 Ryan Henderson wrote:
> > >>
> > >> Hi all,
> > >>
> > >> Not so sure this is the correct list to post to
> > >
> > > I think you've found the right list.
> > >
> > >> but anyway here goes.
> > >>
> > >> I have been developing a product that synchonises media with
> a Quick Time
> > >> movie (currently it uses QT chapter tracks and Href tracks).
> The media can
> > >> include Text, Images, other Movies, and Web Sites. Now
> pretty much all of
> > >> the media here can be displayed using SMIL. However to
> integrate SMIL into
> > >> our existing product easier we would like to use pre
> developed java script
> > >> calls.
> > >
> > > My personal opinion is that SMIL was not designed with scripting high
> > > on the agenda...
> > >
> > >> So in a nutshell my question is: At predetermined times within a SMIL
> > >> presentation can java script calls be made? For example we
> have a call to
> > >> display a web site in a new window, this may be made at say
> 2minutes and 31
> > >> seconds in to the movie...
> > >
> > > I think you have two problems here.
> > > 1) Does your SMIL player support javascript?
> >
> > Well we were initially looking at using IE as our existing delivery
> > environment is the web. It obviously support java script.
> >
> >
> > >  I do not know any that does, but if you've developed your
> own SMIL player,
> > >  the second question is:
> > > 2) How do you encode it in SMIL?
> > >
> > >  If you want to stick to the SMIL REC, the only way I can think of
> > >  is using the <ref> element with the appropriate MIME type
> > >  attribute, and than using a data: URI scheme:
> > >
> > >     <ref type="application/javascript"
> > >          src="data:jscript.function.call()"/>
> > >
> > >  Note that in the example above, I "forgot" to escape the string
> > >  after "data:", but after proper escaping, elegance is not the first
> > >  word that comes to mind...
> > >
> > >  You could also implement a SMIL extension using your own namespace:
> > >
> > >  <myext:script
> xmlns:myext="http://www.mycompany.com/smil/script/extension">
> > >    jscript.function.call()
> > >  </myext:script>
> > >
> > > I hope this helps,
> > >
> >
> > Thanks, hopefully over the next month I will be investigating
> the issue in
> > more depth and I will let you know how I go.
>
>
> -- Jacco
Received on Friday, 11 April 2003 13:43:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:53:28 GMT