Simple Datetime
2022-04-01T20:00:00
Every SMIL media and playlist container can include two trigger attributes. They are represented by the begin
and end
attributes.
excl
tag. In this only case, the value is indefinite. This prevents that children of excl
will start automatically. Furthermore, due to the absolute nature there are some restrictions when using begin in children seq
tag. There is only one positive time clock value possible.
You can define more than one trigger and separate them with a semicolon (;).
Currently, garlic-player supports six kind, of triggers in begin
and end
attributes.
Furthermore, it supports the same value types like dur-attribute (media, indefinite, and clock value).
Wallclock supports the ISO-8601 datetime specification with repeat periods.
2022-04-01T20:00:00
The company IAdea adds with weekday an interesting non-standard feature, which garlic-player also supports.
2022-04-01+w1T00:00:00
2022-04-01-w1T00:00:00
This can be very helpful, if you want to trigger repeatedly different opening times in the week in shop or common in retail.
It is possible to include ISO 8601 compatible periods for repeats. The format is: [datetime]P[YY][MM][WW][DD][T[hH][mM][s[.f]S]]
R/2022-04-01T13:00:00/P1D
You can also limit the repeats
R12/2022-04-01T12:00:00/PT1H
You can study a sophisticated real-world example for wallclock triggers.
There are two opportunities, the SMIL syncbase (begin|end) or the similar beginEvent/endEvent. We focus first on syncbase. You can trigger a start or stop of a media with a start or stop of another media. The media which acts as trigger must define a unique ID.
<par xml:id="simple par">
<video region="screen1" xml:id="video0001" src="0001.mp4" fit="meet" />
<img region="screen2" src="video.jpg" begin="video0001.begin" end="video0001.end" fit="meet" />
<img region="screen3" src="end.jpg" begin="video0001.end" dur="indefinite" fit="meet" />
</par>
When the video starts in zone 1 it triggers the video.jpg to be shown in zone 2. After ending, it triggers the stop of video.jpg and the beginning of end.jpg.
Compare to the sim event-syntax:
<par xml:id="simple par">
<video region="screen1" xml:id="video0001" src="0001.mp4" fit="meet" />
<img region="screen2" src="video.jpg" begin="video0001.beginEvent" end="video0001.endEvent" fit="meet" />
<img region="screen3" src="end.jpg" begin="video0001.endEvent" dur="indefinite" fit="meet" />
</par>
SyncBase is a relict of SMIL 1.0. In this way SMIL 3.0 stay compatible with older SMIL files.
With accesskey you can define a user interaction through a keyboard or sensors (if supported).
accesskey(A)
Real-world example for accesskey-triggers
The event activateEvent defines an activity via touch screen or mouse click. You have to specify an explicit media ID for that, too.
<excl>
<priorityClass>
<video begin="touchme.activateEvent" src="played_after_touch.mkv"/>
</priorityClass>
<priorityClass higher="pause">
<seq begin="0" repeatCount="indefinite">
<img id="touchme" dur="indefinite" src="touch_me.jpg" />
</seq>
</priorityClass>
</excl>
This activateEvent will work on images and videos media. It makes no sense to use it while displayed websites or widgets as there are interactive by default and the click will be gone through to website.
In case of a widget, you should better use the network triggers, which we discuss next.
Real-world example for activateEvent
This is not standard and added by IAdea, but it is so useful, that we implemented it also to the garlic-player from release 0.6.0.
Some SMIL player include a local http-server for serving a restful API. That means that you can control the player via network. That gave us four great opportunities:
<excl repeatCount="indefinite">
<priorityClass >
<img begin="notify(play0001)" src="0001.jpg" dur="10s"/>
<img begin="notify(play0002)" src="0002.jpg" fit="fill" dur="10s" />
</priorityClass>
<priorityClass higher="pause">
<img src="image.jpg" dur="indefinite" />
</priorityClass>
</excl>
In every trigger, you can also set an additional clock time value. Let's take the last network trigger as base for the example.
<excl repeatCount="indefinite">
<priorityClass >
<img begin="notify(play0001)+2s" src="0001.jpg" dur="10s"/>
<img begin="notify(play0002)+5s" src="0002.jpg" fit="fill" dur="10s" />
</priorityClass>
<priorityClass higher="pause">
<img src="image.jpg" dur="indefinite" />
</priorityClass>
</excl>
SMIL supports positive and negative values. Garlic-player currently supports only positive values.