Fixed Playlist, Dynamic Content
There may be very simple digital signage use cases where the playlist stays the same (looping through the same file name links) but the user wishes to be able to quickly update the playback by replacing media files at the URLs. SMIL can easily accommodate that.
When using the following technique, make sure you update the media on the file server using an "atomic" file update operation such as the Windows "move" or the Linux "mv" command. If not handled carefully, the following technique can cause partially updated files to be played if the file server serves partially completed files while they are being uploaded.
Suppose you want to play a simple loop containing a JPEG picture and a video only, and you want to update the media files (when needed) simply by changing the media files themselves without modifying the playlist.
You can accomplish the tasking using the following SMIL script:
<smil> <head /> <body> <par> <!-- the Playlist block --> <seq repeatCount="indefinite"> <img src="http://server/sign1.jpg" dur="5s"> <param name="cacheControl" value="onlyIfCached" /> </img> <video src="http://server/sign2.mpg"> <param name="cacheControl" value="onlyIfCached" /> </video> </seq> <!-- the Check-for-Update block --> <par repeatCount="indefinite"> <seq dur="60s" /> <!-- specify refresh interval here --> <seq> <prefetch src="http://server/sign1.jpg" /> <prefetch src="http://server/sign2.mpg" /> </seq> </par> </par> </body> </smil>
Note that a line of "cacheControl" parameter is added to every item in the playlist so that when new versions of the media file is detected, the old version is played until the new one is completely loaded in cache.
The second block checks every 60 seconds (can be modified as needed) for changes in the media files listed in this block. If a change is detected, the new file is loaded in the background and automatically played in the first block when it is completed loaded in cache.