This project is read-only.

Getting Started: JavaScript

Setting up your project and solution

1. Download the Microsoft.PlayerFramework.SiteCatalyst WinRT project and extract it to your hard drive.
2. Download the Adobe SiteCatalyst SDK for Windows 8. Note: you will need an account with Adobe to access this.
3. Extract the file: ADMS.Measurement.winmd from the Site Catalyst SDK and save it next to the folder that Microsoft.PlayerFramework.SiteCatalyst was extracted to. For example:
ADMS_Location.png
Note: if you save it elsewhere, you will just need to remove and re-add the reference in the Microsoft.PlayerFramework.SiteCatalyst project.
Warning: you may need to unblock the winmd since it was downloaded from the web. Close Visual Studio, right clicking on the file choose Properties, and click Unblock.
4. Open your main project and add the Microsoft Player Framework Analytics Plugin to your project references.
References_Js.png
5. Add the Microsoft.PlayerFramework.SiteCatalyst project you downloaded in step 1 to your solution.
6. Add references to both the Microsoft.PlayerFramework.SiteCatalyst project and the ADMS.Measurement.winmd assembly to your main project.

Initializing the MediaPlayer

1. In your html page, add the script reference to the analytics plugin. Make sure it is after the core player framework script and css references.
<!-- Player framework core player -->
<link href="/Microsoft.PlayerFramework.Js/css/PlayerFramework-dark.css" rel="stylesheet" />
<script src="/Microsoft.PlayerFramework.Js/js/PlayerFramework.js"></script>

<!-- Player framework analytics plugin -->
<script src="/Microsoft.PlayerFramework.Js.Analytics/js/PlayerFramework.Analytics.js"></script>
2. In your default.js, create and add the SiteCatalystLoggingTarget to the analytics logging service.
args.setPromise(WinJS.UI.processAll().done(function () {
    var mediaPlayerElement = document.getElementById("player");
    var mediaPlayer = mediaPlayerElement.winControl;

    var siteCatalystLoggingTarget = new Microsoft.PlayerFramework.SiteCatalyst.SiteCatalystLoggingTarget();
    Microsoft.VideoAnalytics.LoggingService.current.loggingTargets.append(siteCatalystLoggingTarget);
}));
3. Supply an ID for your media asset to the Site Catalyst logging target immediately before setting the source on the MediaPlayer. This helps identify which video the data is associated with.
args.setPromise(WinJS.UI.processAll().done(function () {
    var mediaPlayerElement = document.getElementById("player");
    var mediaPlayer = mediaPlayerElement.winControl;

    var siteCatalystLoggingTarget = new Microsoft.PlayerFramework.SiteCatalyst.SiteCatalystLoggingTarget();
    Microsoft.VideoAnalytics.LoggingService.current.loggingTargets.append(siteCatalystLoggingTarget);

    // instead of setting in html, we could set this in code:
    mediaPlayer.analyticsPlugin.mediaData.push({ key: Microsoft.PlayerFramework.SiteCatalyst.SiteCatalystLoggingTarget.videoIdKey, value: "bigbuckbunny" });
    mediaPlayer.src = "http://smf.blob.core.windows.net/samples/videos/bigbuck.mp4";
}));
4. Lastly, read the Site Catalyst SDK documentation to learn more about how to initialize and configure the Site Catalyst SDK. You will need to make calls to both:
ADMS.Measurement.ADMS_Measurement.instance
...and...
ADMS.Measurement.ADMS_MediaMeasurement.instance

Once you've done this, the analytics plugin will automatically start generating logs when you play media in your app and pass them along to the SiteCatalystLoggingTarget which will in turn call the appropriate APIs at the right time on the Site Catalyst SDK. The Site Catalyst SDK will package and send this data to your account in the cloud.

Getting Started: Xaml

Setting up your project and solution

1. Download the Microsoft.PlayerFramework.SiteCatalyst WinRT project and extract it to your hard drive.
2. Download the Adobe SiteCatalyst SDK for Windows 8. Note: you will need an account with Adobe to access this.
3. Extract the file: ADMS.Measurement.winmd from the Site Catalyst SDK and save it next to the folder that Microsoft.PlayerFramework.SiteCatalyst was extracted to. For example:
ADMS_Location.png
Note: if you save it elsewhere, you will just need to remove and re-add the reference in the Microsoft.PlayerFramework.SiteCatalyst project.
Warning: you may need to unblock the winmd since it was downloaded from the web. Close Visual Studio, right clicking on the file choose Properties, and click Unblock.
4. Open your main project and add the Microsoft Player Framework Analytics Plugin to your project references.
References_Xaml.png
5. Add the Microsoft.PlayerFramework.SiteCatalyst project you downloaded in step 1 to your solution.
6. Add references to both the Microsoft.PlayerFramework.SiteCatalyst project and the ADMS.Measurement.winmd assembly to your main project.

Initializing the MediaPlayer

1. In your page that plays video, create an AnalyticsPlugin and add it to the MediaPlayer's plugin collection.
using Microsoft.PlayerFramework.Analytics;

public MainPage()
{
    this.InitializeComponent();

    // create and add the analytics plugin
    var analyticsPlugin = new AnalyticsPlugin();

    // expose the analytics plugin to the player framework
    player.Plugins.Add(analyticsPlugin);
}
2. Add the Site Catalyst logging target responsible for capturing logs generated by the analytics plugin.
using Microsoft.PlayerFramework.Analytics;
using Microsoft.PlayerFramework.SiteCatalyst;
using Microsoft.VideoAnalytics;

public MainPage()
{
    this.InitializeComponent();

    // create and add the analytics plugin
    var analyticsPlugin = new AnalyticsPlugin();

    // expose the analytics plugin to the player framework
    player.Plugins.Add(analyticsPlugin);
            
    // create a logging target for Adobe SiteCatalyst to capture logs
    LoggingService.Current.LoggingTargets.Add(new SiteCatalystLoggingTarget());
}
3. Supply an ID for your media asset to the Site Catalyst logging target immediately before setting the source on the MediaPlayer. This helps identify which video the data is associated with.
using Microsoft.PlayerFramework.Analytics;
using Microsoft.PlayerFramework.SiteCatalyst;
using Microsoft.VideoAnalytics;

public MainPage()
{
    this.InitializeComponent();

    // create and add the analytics plugin
    var analyticsPlugin = new AnalyticsPlugin();

    // expose the analytics plugin to the player framework
    player.Plugins.Add(analyticsPlugin);
            
    // create a logging target for Adobe SiteCatalyst to capture logs
    LoggingService.Current.LoggingTargets.Add(new SiteCatalystLoggingTarget());

    analyticsPlugin.MediaData[SiteCatalystLoggingTarget.VideoIdKey] = "bigbuckbunny";
    player.Source = new Uri("http://smf.blob.core.windows.net/samples/videos/bigbuck.mp4");
}
4. Lastly, read the Site Catalyst SDK documentation to learn more about how to initialize and configure the Site Catalyst SDK. You will need to make calls to both:
ADMS.Measurement.ADMS_Measurement.Instance
...and...
ADMS.Measurement.ADMS_MediaMeasurement.Instance

Once you've done this, the analytics plugin will automatically start generating logs when you play media in your app and pass them along to the SiteCatalystLoggingTarget which will in turn call the appropriate APIs at the right time on the Site Catalyst SDK. The Site Catalyst SDK will package and send this data to your account in the cloud.

Getting Started: WP8

Setting up your project and solution

1. Download the Microsoft.PlayerFramework.SiteCatalyst WP8 project and extract it to your hard drive.
2. Download the Adobe SiteCatalyst SDK for Windows Phone 8. Note: you will need an account with Adobe to access this.
3. Extract the file: ADMS.Measurement.dll from the Site Catalyst SDK and save it next to the folder that Microsoft.PlayerFramework.SiteCatalyst was extracted to. For example:
ADMS_Location_WP.png
Note: if you save it elsewhere, you will just need to remove and re-add the reference in the Microsoft.PlayerFramework.SiteCatalyst project.
Warning: you may need to unblock the dll since it was downloaded from the web. Close Visual Studio, right clicking on the file choose Properties, and click Unblock.
4. Open your main project and add the Microsoft Player Framework Analytics Plugin to your project references.
References_WP.png
5. Add the Microsoft.PlayerFramework.SiteCatalyst project you downloaded in step 1 to your solution.
6. Add references to both the Microsoft.PlayerFramework.SiteCatalyst project and the ADMS.Measurement.dll assembly to your main project.

Initializing the MediaPlayer

1. In your page that plays video, create an AnalyticsPlugin and add it to the MediaPlayer's plugin collection.
using Microsoft.PlayerFramework.Analytics;

public MainPage()
{
    this.InitializeComponent();

    // create and add the analytics plugin
    var analyticsPlugin = new AnalyticsPlugin(null);

    // expose the analytics plugin to the player framework
    player.Plugins.Add(analyticsPlugin);
}
2. Add the Site Catalyst logging target responsible for capturing logs generated by the analytics plugin.
using Microsoft.PlayerFramework.Analytics;
using Microsoft.PlayerFramework.SiteCatalyst;
using Microsoft.VideoAnalytics;

public MainPage()
{
    this.InitializeComponent();

    // create and add the analytics plugin
    var analyticsPlugin = new AnalyticsPlugin(null);

    // last, expose the analytics plugin to the player framework
    player.Plugins.Add(analyticsPlugin);
            
    // create a logging target for Adobe SiteCatalyst to capture logs
    LoggingService.Current.LoggingTargets.Add(new SiteCatalystLoggingTarget());
}
3. Supply an ID for your media asset to the Site Catalyst logging target immediately before setting the source on the MediaPlayer. This helps identify which video the data is associated with.
using Microsoft.PlayerFramework.Analytics;
using Microsoft.PlayerFramework.SiteCatalyst;
using Microsoft.VideoAnalytics;

public MainPage()
{
    this.InitializeComponent();

    // create and add the analytics plugin
    var analyticsPlugin = new AnalyticsPlugin(null);

    // last, expose the analytics plugin to the player framework
    player.Plugins.Add(analyticsPlugin);
            
    // create a logging target for Adobe SiteCatalyst to capture logs
    LoggingService.Current.LoggingTargets.Add(new SiteCatalystLoggingTarget());

    analyticsPlugin.MediaData[SiteCatalystLoggingTarget.VideoIdKey] = "bigbuckbunny";
    player.Source = new Uri("http://smf.blob.core.windows.net/samples/videos/bigbuck.mp4");
}
4. Lastly, read the Site Catalyst SDK documentation to learn more about how to initialize and configure the Site Catalyst SDK. You will need to make calls to both:
ADMS.Measurement.ADMS_Measurement.Instance
...and...
ADMS.Measurement.ADMS_MediaMeasurement.Instance

Once you've done this, the analytics plugin will automatically will start generating logs when you play media in your app and pass them along to the SiteCatalystLoggingTarget which will in turn call the appropriate APIs at the right time on the Site Catalyst SDK. The Site Catalyst SDK will package and send this data to your account in the cloud.

Last edited Aug 22, 2013 at 5:21 PM by timgreenfield, version 34