Difference between revisions of "Play logs"

From A-SMIL.org
Jump to: navigation, search
m (Added link to inventory reporting)
(Added example rewrite rule)
Line 25: Line 25:
 
A log file in the format <TT>playerlog-{time-based-uuid}.xml</TT> will be placed in the server path.
 
A log file in the format <TT>playerlog-{time-based-uuid}.xml</TT> will be placed in the server path.
  
'''If your server does not support WebDAV''', you can simulate the same by implementing a server-side script to handle an HTTP PUT against the URL <TT>http://server/webdav_path/playerlog-{time-based-uuid}.xml</TT>. Since the URL is dynamic and time-based, you will need to employ ''URL rewrite'' techniques in your server configuration to redirect the PUT request to your handler. Popular servers including Apache and Microsoft IIS do provide support for URL rewriting. Consult your web server documentation for details.
+
=== Sending logs to server-side script ===
 +
 
 +
If your server does not support WebDAV, you can simulate the same by implementing a server-side script to handle an HTTP PUT against the URL <TT>http://server/webdav_path/playerlog-{time-based-uuid}.xml</TT>. Since the URL is dynamic and time-based, you will need to employ ''URL rewrite'' techniques in your server configuration to redirect the PUT request to your handler. Popular servers including Apache and Microsoft IIS do provide support for URL rewriting. Consult your web server documentation for details.
 +
 
 +
==== Microsoft IIS ====
 +
 
 +
# Set up a rewrite rule to match regular expression "webdav_path/playerlog-(.*).xml" (where webdav_path is replaced by the "action" field you specified)
 +
# Have the rewrite rule output as "loghandler.aspx?{R:1}" (where {R:1} is to be replaced by the pattern matched) so your handler (here ''loghandler.aspx'' as an example) will receive the time-based UUID as its query parameter
  
 
== Designating a Log ID to a Media File ==
 
== Designating a Log ID to a Media File ==

Revision as of 04:10, 8 September 2010

A-SMIL players can report proof-of-play records as media files are played. The reports can be placed into a WebDAV folder or passed to a CGI hanlder that collects the information.

Designating a URL to the Log Storage

In your SMIL script, you need to add a section to your head section to define where the media player should upload its logs. A typical definition looks like this.

<head>
  <metadata>
    <x-server xmlns="http://schemas.adfotain.org/adapi-1.0">
      <subscriptionList>
        <subscription>
          <type>PlaylogCollection</type>
          <action>http://server/webdav_path</action>
          <method>put</method> 
        </subscription>
      </subscriptionList>
    </x-server>
  </metadata>
</head>

Here "http://server/webdav_path" is the path to the WebDAV-enabled direction on your log server.

A log file in the format playerlog-{time-based-uuid}.xml will be placed in the server path.

Sending logs to server-side script

If your server does not support WebDAV, you can simulate the same by implementing a server-side script to handle an HTTP PUT against the URL http://server/webdav_path/playerlog-{time-based-uuid}.xml. Since the URL is dynamic and time-based, you will need to employ URL rewrite techniques in your server configuration to redirect the PUT request to your handler. Popular servers including Apache and Microsoft IIS do provide support for URL rewriting. Consult your web server documentation for details.

Microsoft IIS

  1. Set up a rewrite rule to match regular expression "webdav_path/playerlog-(.*).xml" (where webdav_path is replaced by the "action" field you specified)
  2. Have the rewrite rule output as "loghandler.aspx?{R:1}" (where {R:1} is to be replaced by the pattern matched) so your handler (here loghandler.aspx as an example) will receive the time-based UUID as its query parameter

Designating a Log ID to a Media File

By default, playbacks of media files are not logged. If you want to report a play log when a media file is played, you need to specify so in your SMIL script. The following example illustrates how to assign a log ID to a video file so a log is generated when it is played.

<video src="http://server/video.mpg">
  <param name="logContentId" value="uuid-video" />
</video>

In the example above, uuid-video is a ID string that you can arbitrarily assign so when the video is played, a record is sent to the log server indicating the designated ID is bring played.

Log File Format

A-SMIL uploads log files to the server similar to the POPAI Log Standard 1.0 with several redundant fields removed to optimize network performance. A log file uploaded to the server looks like this.

<report xmlns="http://schemas.adfotain.org/adapi-1.0">
  <date>{createDate}</date>
  <version>1.0</version>
  <player id="{playerId}" multi-channel="true">
    <contentPlayLog displayDeviceId="display:0">
      <contentPlayed>
        <contentId>{log-id}</contentId>
        <startTime>{start-time}</startTime>
        <endTime>{end-time}</endTime>
      </contentPlayed>
      <!-- ... more contentPlayed records -->
    </contentPlayLog>
  </player>
</report>

Related