This project has moved and is read-only. For the latest updates, please go here.

WP 8.1 and m3u8 playlist

Nov 19, 2014 at 9:54 AM
This is probably a very nooby question but a friend and I have found ourselves at a standstill, as we cannot get any further with our app.

We are trying to open a stream (m3u8) from Twitch Tv that looks like this:
So this is where it gets difficult, we have literally no idea on how to actually open this stream through Windows Phone Streaming Media.

We were able to successfully import the library, but had no idea where to go from here.

I'm hoping that you could provide me with a little code snippet on where to go from here, as I'm very confused and this seems to be the only solution.
Nov 19, 2014 at 9:47 PM
A friend of mine helped me to get it to work :)
Nov 19, 2014 at 9:52 PM
Get a copy of the current source, open the HlsPlayer.VS2013.sln solution, set HlsPlayer.WP81 as the default startup project, set the architecture to x86. It shouldn't matter which emulator it is using, but I tend to use "Emulator 8.1 U1 WVGA 4 inch 512MB". Do a "Build Solution" to make sure that everything does build. Then start the debugger and make sure that the default stream plays.

If you prefer, you can use the latest alpha build instead of the source code.

If that works, go to HlsView.WinRT.Shared\TrackManager.cs and put your own URL (or URLs) there and try again.

If you prefer to use Player Framework, then use SamplePlayer.WP81 instead. The URL is set in SamplePlayer.WinRT.Shared\TrackManager.cs (or it can be set directly in SamplePlayer.WinRT.Shared\MainPage.xaml as the "Source" attribute for "<pf:MediaPlayer>".

You might also want to take a look at the Petri Louhelainen article linked from "Instructions on how to include HLS support for Universal/Windows Phone 8.1 RT-projects."

If you don't have it installed, you will probably want to install Player Framework v2.0. If you still have problems, make sure your Visual Studio is up to date (VS2013 is currently on Update 4). Check the "Updates" page in "Tools" -> "Extensions and Updates..." to make sure you aren't missing anything. If that still doesn't work, open a command line (cmd or PowerShell) and run Scripts\build2013.bat.
Nov 19, 2014 at 9:54 PM
Oops, I didn't see your response until I had posted mine.

Good to know that you got it working.
Nov 20, 2014 at 6:55 PM
I actually switched to your method where I create a stream using CreateMediaStreamSourceAsync method as I found it more reliable. However I'm still getting an error every now and then when I try to load a stream where it says it failed to decode. Any ideas? Image
Nov 20, 2014 at 6:59 PM
Edited Nov 20, 2014 at 7:21 PM
When this happens, there is a quick glance of the video and then it stops :P

I'm using the dll's from Source\App\WinRT\HlsView.WP81\bin\ARM\Debug (SM.Media, SM.Media.Builder, SM.Media.Platform.WinRT, SM.TsParser)

I'm using VS 2013 Community Edition with Update 4 :)

Also I can take the stream and open it in VLC and it's able to retrieve the stream successfully :)
Nov 20, 2014 at 7:49 PM
Is it apparently random or are you seeing it consistently with some streams and not with others? Are there any VOD streams that do this consistently?

Does the debug output window show anything of note?

Which version of the phonesm code are you using?


BTW, if you want the same folder structure as with the binary builds, run the "Scripts/buildAll.bat" and then take a look in the "Distribution" directory. It does run the 2012 build scripts, so it requires VS2012, but you should still be able to run the individual 2013 scripts.
Nov 25, 2014 at 9:39 PM
The error occured because we had enabled Stereo3DVideoRenderMode="Stereo" >_> sorry for the inconvenience.
Nov 28, 2014 at 10:21 AM
No problem...