Customer Sign In

upLynk

Microsoft Xbox 360 SDK

Overview

This guide is provided to assist an integrator with the use of the upLynk Xbox 360 SDK. The Xbox 360 SDK provided by upLynk comes with three plugins. UplynkPlugins.HLS, UplynkPlugins.Captions and UplynkPlugins.Thumbnails. These plugins are loaded automatically when placed in the bin of your application.

Downloads

Please contact upLynk support for the link to download the latest version of this library.

UplynkPlugins.HLS

The UplynkPlugins.HLS plugin provides playback support for HLS content for your app. Adding the UplynkPlugins.HLS.HLSPlayer control to your xaml page is required.

UplynkPlugins.HLS.HLSPlayer API:

Events
AdMarkersAddedOccurs when all the ad markers, if any, have been added to the AdMarkers collection.
AssetInfoChangedOccurs when the player starts playing a new asset.
AudioTracksLoadedOccurs when the asset's audio tracks, if any, have been loaded. An audio track can now be set using the SelectedAudioTrack property. The default audio track is already selected.
SubtitleTrackLoadedOccurs when the SelectedSubtitleTrack has been loaded and the track slices have begun downloading.
SubtitleTracksLoadedOccurs when the asset's subtitle tracks, if any, have been loaded. A subtitle track can now be set using the SelectedSubtitleTrack property.
Properties
AvailableAudioTracksGets the list of available audio tracks.
AvailableBandwidthsGets the list of available track bandwidths in bytes per second.
AvailableResolutionsGets the list of available video resolutions.
AvailableSubtitleTracksGets the list of available subtitle tracks.
SelectedAudioTrackGets or sets the selected audio track.
SelectedSubtitleTrackGets or sets the selected subtitle track. Set to null to unselect the current selected subtitle track.

Basic Playback

Basic playback using the UplynkPlugins.HLS plugin and the HLSPlayer class.

XAML Code
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<xbox:XboxApplicationPage
      x:Class="SamplePlayerApplication.Player"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:xbox="clr-namespace:Microsoft.Xbox.Controls;assembly=Microsoft.Xbox"
      xmlns:uplynk="clr-namespace:UplynkPlugins.HLS;assembly=UplynkPlugins.HLS"
      xmlns:meta="clr-namespace:Microsoft.SilverlightMediaFramework.Utilities.Metadata;assembly=MMPPF.Utilities.Xbox"
      mc:Ignorable="d"
      d:DesignHeight="720" d:DesignWidth="1280">
      <Grid>
          <uplynk:HLSPlayer x:Name="UplynkPlayer"/>
      </Grid>
</xbox:XboxApplicationPage>
C# Code
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
namespace SamplePlayerApplication
{
    public partial class Player
    {
        public Player()
        {
            InitializeComponent();

            UplynkPlayer.MediaEnded += UplynkPlayer_MediaEnded;
        }

        private void UplynkPlayer_MediaEnded(object sender, EventArgs e)
        {
            UplynkPlayer.Stop();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            string source = NavigationContext.QueryString["source"];

            var playlistItem = new PlaylistItem { MediaSource = new Uri(source),
                                                  DeliveryMethod = DeliveryMethods.AdaptiveStreaming,
                                                  MediaType = "application/x-mpegURL",
                                                  MediaAssetId = "someId" };

            UplynkPlayer.Playlist.Add(playlistItem);
            UplynkPlayer.Play();
        }
    }
}
    

Closed Captions

Captions can be enabled by adding the UplynkPlugins.Captions plugin to the output directory of your application. The Captions plugin has several settings that can be set on the UplynkPlayer Xaml declaration. For more information on these settings, please see the Xbox 360 MMPPF Addons documentation.

UplynkPlugins.Captions Settings
Uplynk.Captions.Enable708CaptioningBoolean value indicating if 708 caption support is enabled.
Uplynk.Captions.EnableWebVTTCaptioningBoolean value indicating if WebVTT caption support is enabled.

Enabling Captions Xaml Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<xbox:XboxApplicationPage
      x:Class="SamplePlayerApplication.Player"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:xbox="clr-namespace:Microsoft.Xbox.Controls;assembly=Microsoft.Xbox"
      xmlns:uplynk="clr-namespace:UplynkPlugins.HLS;assembly=UplynkPlugins.HLS"
      xmlns:meta="clr-namespace:Microsoft.SilverlightMediaFramework.Utilities.Metadata;assembly=MMPPF.Utilities.Xbox"
      mc:Ignorable="d"
      d:DesignHeight="720" d:DesignWidth="1280">
      <Grid>
          <uplynk:HLSPlayer x:Name="UplynkPlayer">
              <uplynk:HLSPlayer.GlobalConfigMetadata>
                  <meta:MetadataItem Key="Uplynk.Captions.Enable708Captioning" Value="false"/>
                  <meta:MetadataItem Key="Uplynk.Captions.EnableWebVTTCaptioning" Value="true"/>
              </uplynk:HLSPlayer.GlobalConfigMetadata>
          <uplynk:HLSPlayer/>
      </Grid>
</xbox:XboxApplicationPage>
      

Thumbnails

Thumbnails can be enabled by adding the UplynkPlugins.Thumbnails plugin to the output directory of your application. The Thumbnails plugin has several settings that can be set on the UplynkPlayer Xaml declaration.

UplynkPlugins.Thumbnails Settings
Uplynk.Thumbnails.MaxCacheSizeInteger value indicating the maximum number of thumbnails that will be cached. Default value is 30.
Uplynk.Thumbnails.MaxSimultaneousRequestsInteger value indicating the maximum number of simultaneous requests that can occur. Default value is 2.
Uplynk.Thumbnails.PermanentCacheSizeInteger value indicationg the total number of thumbnails that will be cached permanently. Default value is 10.
Uplynk.Thumbnails.PredictionIntervalInteger value, in milliseconds, indicating the minimum amount of time passed before a new prediction will occur. Default value is 250.
Uplynk.Thumbnails.ThumbnailRequestDelayInteger value, in milliseconds, indicating the delay between subsequent thumbnail requests. Default value is 50.

Setting Thumbnails Settings Xaml Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<xbox:XboxApplicationPage
      x:Class="SamplePlayerApplication.Player"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:xbox="clr-namespace:Microsoft.Xbox.Controls;assembly=Microsoft.Xbox"
      xmlns:uplynk="clr-namespace:UplynkPlugins.HLS;assembly=UplynkPlugins.HLS"
      xmlns:meta="clr-namespace:Microsoft.SilverlightMediaFramework.Utilities.Metadata;assembly=MMPPF.Utilities.Xbox"
      mc:Ignorable="d"
      d:DesignHeight="720" d:DesignWidth="1280">
      <Grid>
          <uplynk:HLSPlayer x:Name="UplynkPlayer">
              <uplynk:HLSPlayer.GlobalConfigMetadata>
                  <meta:MetadataItem Key="Uplynk.Thumbnails.MaxSimultaneousRequests" Value="1"/>
              </uplynk:HLSPlayer.GlobalConfigMetadata>
          <uplynk:HLSPlayer/>
      </Grid>
</xbox:XboxApplicationPage>