Re:

Jack Jansen <[email protected]> Fri, 28 May 2010 00:25:06 +0200
Newsgroups gmane.comp.web.smil
Message-ID <[email protected]>
 =20
On 27 mei 2010, at 20:14, Sanja C. wrote:

> Hi,
>=20
> we're considering a SMIL-based solution for stand-alone =
multimedia-presentations (i.e. digital signage) in our organisation, but =
are not sure how well it fits our needs with regards to integrating =
calendar time range specific content into the "normal flow" of a =
seq/par-driven presentation.
>=20
> We'd be very grateful if some more SMIL-experienced people would =
comment on the following two scenarios:
>=20
> __Scenario 1:__
>=20
> Consider a presentation of the following form that continually loops =
through a number of multimedia pages:
>=20
> <seq repeatCount=3D"indefinite">
>     <ref title=3D"Page 1"/>
>     <par>
>         <ref title=3D"Page 2"/>
>         <ref title=3D"specialOverlay"/>
>     </par>
>     <ref title=3D"Page 3"/>
>     <ref title=3D"Page 4"/>
>     ...
> </seq>
>=20
> Now, is it possible to add SMIL markup to this presentation that will =
enforce the following constraints, respectively:
>=20
>    example A)  Only show the "specialOverlay" on [Sunday, 30. Mai =
2010, 9am - 18am] (or any other specific calendar time range)
>    example B)  Only show the "specialOverlay" on [Sunday, between 9am =
- 18am] (meaning: *every* sunday)
>    example C)  Only show the "specialOverlay" on holidays (where the =
data about which days are holidays is supplied through an external file)
>=20
> ..without otherwise affecting the behaviour of the seq element?

Sanja,
the short answer is that this is not directly possible with SMIL 3.0. =
Wallclock timing (see =
http://www.w3.org/TR/2008/REC-SMIL3-20081201/smil-timing.html#Timing-Wallc=
lockSyncValueSyntax) allows you to specify a single time, a single date =
or a single date+time. Unfortunately things like "every sunday" are not =
expressible.

The slightly longer answer is that it is possible by using a tiny =
external agent (or script). SMIL State (see =
http://www.w3.org/TR/2008/REC-SMIL3-20081201/smil-state.html) was =
specifically designed with this use in mind (among other things): the =
whole SMIL presentation is declarative, with some parts based on SMIL =
State variable(s). This variable is then changed by the external agent.

Your SMIL document would look something like this:
...
 <head>
  <state xmlns=3D"">
   <data>
    <showSpecialOverlay>0</showSpecialOverlay>
   </data>
  </state>
 </head>
 ...
  <par>
   <ref title=3D"Page 2"/>
   <ref expr=3D"showSpecialOverlay"  title=3D"specialOverlay"/>
  </par>
...

Now, specialOverlay will only be shown if, at the time it is eligible to =
play, the showSpecialOverlay variable is true. So, you would supply a =
script that sets/clears this variable depending on the date/time. Or you =
could make it depend on anything else you want (think: attach a camera =
with face recognition to your billboard and count the number of people =
watching it, to name something completely different:-).

You could also do things even more declarative, by having the script =
only filling in relevant parts of date and time, for example every hour, =
in a data structure like
  <state xmlns=3D"">
    <data>
      <year/>
      <month/>
      <day/>
      <weekday/>
      <hour/>
    </data>
  </state>
your example B could now be coded as
   <ref expr=3D"weekday=3D7 and hour &gt; 9 and hour &lt; 18" =
title=3D"specialOverlay"/>

Many more wild things are possible with SMIL State, let me know if =
you're interested and I can point you to a paper we wrote on the =
subject.

>=20
> __Scenario 2:__
>=20
> Consider again a presentation continually looping through a fixed set =
of pages:
>=20
> <seq repeatCount=3D"indefinite">
>     <ref title=3D"Page 1"/>
>     <ref title=3D"Page 2"/>
>     <ref title=3D"Page 3"/>
>     ...
> </seq>
>=20
> Imagine this presentation will run around-the-clock, all year long.
> Now, is it possible to specify an alternative <seq></seq> section for =
a specific calendar time range so that at the beginning of this time =
range, the normal seq presentation is halted (no matter what it's =
currently showing), and the alternative <seq></seq> is shown, until the =
end of the time range, when the normal presentation is resumed? (Note: =
it would also be acceptable if the original presentation would then =
re-start at its beginning, instead of resuming exactly where it had left =
off.)

This is easier, assuming single datetime begin and end points:

  <excl>
    <seq begin=3D"0;wallclock(20100605T1800)" =
repeatCount=3D"indefinite">... normal seq... </seq>
    <seq begin=3D"wallclock(20100605T0900)" =
repeatCount=3D"indefinite">...special seq...</seq>
  </excl>

This will play the normal sequence, repeatedly, except from 9AM to 6 PM =
on June 5th, 2010, when it plays the special sequence.
=20
> Is this kind of stuff possible with SMIL 3.0 markup?
>=20
> Note that we *don't* want to use scripting, just XML-based markup (if =
this is not possible with plain SMIL, we'd rather develop a custom =
non-SMIL-based solution altogether, or our own SMIL-extension, or a =
"wrapper" that calls/terminates different SMIL presentation at different =
times).

If you decide on extending SMIL I would be more than happy to provide =
you with some ideas, the use case for richer specification of wallclock =
time constraints should be common for digital signage, and I think that =
it is an important area for SMIL. If you have the time (and inclination) =
to do this extension in a way that would ease possible integration into =
a next version of SMIL (if ever there is going to be one) that would be =
a boon!
--
Jack Jansen, <[email protected]>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma =
Goldman