Fixed Playlist, Dynamic Content

Jump to: navigation, search

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.

Use Case

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.

The Solution

You can accomplish the tasking using the following SMIL script:

  <head />
      <!-- the Playlist block -->
      <seq repeatCount="indefinite">
        <img src="http://server/sign1.jpg" dur="5s">
          <param name="cacheControl" value="onlyIfCached" />
        <video src="http://server/sign2.mpg">
          <param name="cacheControl" value="onlyIfCached" />
      <!-- the Check-for-Update block -->
      <par repeatCount="indefinite">
        <seq dur="300s" /> <!-- specify refresh interval here , the refresh interval is a MUST -->
          <prefetch src="http://server/sign1.jpg" />
          <prefetch src="http://server/sign2.mpg" />

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 5 minutes (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.

The refresh interval can not be skipped, user should consider a reasonable refresh interval based on media content refresh frequency.