Getting Started Guide

Player Framework for Xaml-based Windows store applications

1. Make sure you have installed the tools and SDK for Windows 8.

2. Install the Visual Studio Extension SDK (Microsoft.PlayerFramework.vsix) by double clicking on the file.

3. Create a new project using the Windows Store Application templates for C# or Visual Basic.
xaml-step-1.png

4. Add 'Microsoft Player Framework' to your project references. Under References --> Windows --> Extensions
xaml-step-2.png
Note: the version number may differ depending on what version of the player framework you have installed.

5. Add the PlayerFramework namespace to your xaml file.
xmlns:mmppf="using:Microsoft.PlayerFramework"

6. Add the MediaPlayer control that is part of the PlayerFramework namespace to the body of your Xaml file and set the source to a valid url. For example:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <mmppf:MediaPlayer Source="http://smf.blob.core.windows.net/samples/videos/bigbuck.mp4"/>
</Grid>

That's all you need to get started. Run your app and see video player using the Player Framework. There is an extensive API as well as optional plugins to help customize the experience to the needs of your app.

Adding support for Smooth Streaming

1. Follow the instructions above to create a new app that uses the Microsoft Media Platform Player Framework for Xaml.

2. Install the Visual Studio Extension SDK for the Smooth Streaming Client (this is a separate download).

3. Add 'Microsoft Smooth Streaming Client SDK for Windows 8' and 'Microsoft Visual C++ Runtime Package' to your project References. Under References --> Microsoft--> Extensions

4. Add 'Microsoft Player Framework Adaptive Streaming Plugin' to your project references. Under References --> Windows --> Extensions
ss-step-1.png

5. Modify the MediaPlayer control Xaml so it uses a valid smooth streaming url and adds the Adaptive plugin to the plugins collection on the player framework.
xmlns:adaptive="using:Microsoft.PlayerFramework.Adaptive"

<mmppf:MediaPlayer Source="http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest">
    <mmppf:MediaPlayer.Plugins>
        <adaptive:AdaptivePlugin />
    </mmppf:MediaPlayer.Plugins>
</mmppf:MediaPlayer>
Note: alternatively, you can add the plugin in your code behind

6. Target your app to x86, x64, or ARM. Because the IIS Smooth Streaming Client is written in unmanaged code, AnyCPU will not work and instead you must target and build your app for each platform you wish to support.
ss-step-2.png
ss-step-3.png

That's all you need to get started. Run your test app watch Big Buck Bunny playing in smooth streaming!

Last edited Nov 30, 2012 at 1:15 AM by timgreenfield, version 16

Comments

AshwinBhanushali Jan 22 at 11:55 AM 
Hi Followed the steps mentioned above but I am getting
MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED : HRESULT - 0xC00D36C4 error
when I try to play the live video whose
url is rtsp://sonyentertainment.live-s.cdn.bitgravity.com/cdn-live/_definst_/sonyentertainment/live/feed17
can anyone help me on this.

pdii Jun 6, 2013 at 8:44 PM 
I want to be able to check in all required files for PlayerFramework so that developers and build servers could just get latest and build. They should not have to install the visx file in order to get their builds working.

When I add the Microsoft.PlayerFramework.dll (instead of using the Extensions method documented above) I am able to compile, but I get an error regarding not being able to create an instance of Microsoft.PlayerFramework.MediaPlayer

What is the correct process to incorporate the PlayerFramework dlls w/o having to manually install the vsix file?

Thanks!

robvig Nov 29, 2012 at 8:54 PM 
What would the code look like if I wanted the Source attribute to be dynamic (Data Driven)?
Thanks... Robert (SilverLight Newb)

Antonius123 Nov 4, 2012 at 7:19 PM 
how can you play the audio in the background ?

christostat Sep 19, 2012 at 4:47 PM 
Plain text captions does not seem to be there to add as a reference int the last release? Is fine in the May one I tested...

Will the Plain text captions be included in the final version?

Thanks,
Christos Tatitzikidis

lseidman Sep 17, 2012 at 8:08 AM 
Upon debugging without requesting anything, just before startup:

An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in Test.exe but was not handled in user code

WinRT information: Cannot create instance of type 'Microsoft.PlayerFramework.MediaPlayer' [Line: 19 Position: 26]

Additional information: Unspecified error

vishal8181 Sep 13, 2012 at 2:34 PM 
HI,
I have Posted a question in this,Would be Glad if u guys can help
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/03099f81-fc52-4014-aa56-651bd3a30737

Julienv42 Jun 19, 2012 at 9:45 AM 
I've just tried moving my solution to the root of the disk, it changed nothing.
Here is the stacktrace:
à Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
à Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
à Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action)
à Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func)
à Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
à Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
à Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)

lincolnvu Jun 18, 2012 at 8:58 PM 
System.IO.PathTooLongException is likely because the folder you extract to plus the project name create a very long string (this happened to me before). Try to put it to C: for instant.

Julienv42 Jun 18, 2012 at 4:40 PM 
Oh, it's alternating with another nasty message: a bunch of System.IO.PathTooLongException which makes no more sense.

I've got a 100% repro right now.

Julienv42 Jun 18, 2012 at 4:36 PM 
I've also got the Out of Memory message both in Visual Studio's designer and Blend.
Any clues?

Julien

timgreenfield Jun 4, 2012 at 10:07 PM 
The info above has now been updated to indicate the change where optional plugins must be manually added to the MediaPlayer.Plugins collection.

Also, for those migrating apps created with the Developer Preview version of Windows 8, please remove the xml you manually added to your appxmanifest file. This is no longer needed.

Regards,

Tim Greenfield

ricardoschiller Jun 4, 2012 at 11:57 AM 
I had the playerframework working, with the smooth streaming beta 1 sdk, on the consumer preview. With the release preview smooth streaming videos stopped working.

A need a working version as soon as possible. Do you have an idea of how long it will take to produce a new working version for the win8 release preview?

Thank you,

Ricardo

kevinkao809 Jun 2, 2012 at 1:13 PM 
Out of memory message :
OutOfMemoryException: Insufficient memory to continue the execution of the program.
StrakTrace
at System.Runtime.InteropServices.WindowsRuntime.IVector`1.InsertAt(UInt32 index, T value)
at System.Runtime.InteropServices.WindowsRuntime.VectorToListAdapter.InsertAtHelper[T](IVector`1 _this, UInt32 index, T item)
at System.Runtime.InteropServices.WindowsRuntime.VectorToListAdapter.Insert[T](Int32 index, T item)
InnerException: None

kevinkao809 Jun 2, 2012 at 1:07 PM 
Hi,

I follow above steps, but get below error on Smooth Streaming.

1. In VS 2012 design view, it show "out of memory" on player page.
2."Can't Play Video" when run it.

These two error only happen on Smooth Streaming and XAML-base metro app.

My environment :
Windows 8 Release Preview. (Build 8400), Eng, 32bit
Smooth Streaming SDK Beta 1, Version 1.0
Player Framework Version : 1.2.0

Kevin Kao