private void InitializeSmoothStreaming()
{
extensions = new MediaExtensionManager();
propertySet = new Windows.Foundation.Collections.PropertySet();
// Gets the default instance of AdaptiveSourceManager which manages Smooth
//Streaming media sources.
//
adaptiveSourceManager = AdaptiveSourceManager.GetDefault();
// Sets property key value to AdaptiveSourceManager default instance.
// {A5CE1DE8-1D00-427B-ACEF-FB9A3C93DE2D}" must be hardcoded.
propertySet["{A5CE1DE8-1D00-427B-ACEF-FB9A3C93DE2D}"] = adaptiveSourceManager;
// Registers Smooth Streaming byte-stream handler for “.ism” extension and,
// "text/xml" and "application/vnd.ms-ss" mime-types and pass the propertyset.
// http://*.ism/manifest URI resources will be resolved by Byte-stream handler.
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "text/xml",
propertySet);
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism",
"application/vnd.ms-ss", propertySet);
extensions.RegisterSchemeHandler("Microsoft.Media.AdaptiveStreaming.SmoothSchemeHandler", "ms-sstr:", propertySet);
//var vm = (IPlayFreeVideoViewModel)DataContext;
//vm.AdaptiveSourceManager = adaptiveSourceManager;
//vm.MediaElement = this.MediaElement;
}