Playing HLS (m3u8 playlist) on Windows Phone 8.1
Asked Answered
B

3

3

A friend and I have tried to get the video player on Windows Phone 8.1 to play a m3u8 stream, but we've been unavailable to succeed.

What we've tried:

We've tried with playerframework.codeplex.com (Microsoft Player Framework), but it was unable to load the file.

We also tried with Windows Phone Streaming Media (https://phonesm.codeplex.com/), but we were unable to as much as use this one as we couldn't make sense of their documentation on how we actually had to load the file?

Is there anybody who have worked with this kind of files before? I understand that m3u8 is not natively supported by Windows Phone 8.1

Beckerman answered 18/11, 2014 at 23:8 Comment(2)
Have you tried playerframework.codeplex.com?Lindell
Yes, the first link is incorrect as you can see in my parenthesis :)Beckerman
T
4

Download the player framework, consume the following DLL's:

DLL's to consume

Add the player to your xaml:

xmlns:mmppf="using:Microsoft.PlayerFramework"
xmlns:smmedia="using:SM.Media.MediaPlayer"

 <mmppf:MediaPlayer IsFullScreenVisible="True" IsFullScreenEnabled="True" IsFullScreen="False"  CurrentStateChanged="mPlayer_CurrentStateChanged" x:Name="mPlayer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsFastForwardEnabled="False" IsInfoEnabled="False" IsLive="True" IsMoreEnabled="False" IsRewindEnabled="False" IsRightTapEnabled="False" IsScrubbingEnabled="False" IsSeekEnabled="False" IsSkipBackEnabled="False" IsSkipAheadEnabled="False" IsReplayEnabled="False" IsTimelineVisible="False" IsTimeElapsedVisible="False" IsTimeRemainingVisible="False" RequestedTheme="Dark">
            <mmppf:MediaPlayer.Plugins>
                <smmedia:StreamingMediaPlugin />
            </mmppf:MediaPlayer.Plugins>

        </mmppf:MediaPlayer>

Then set your stream VIA code - or XAML if the URL never changes.

Trueman answered 19/11, 2014 at 20:48 Comment(1)
Hey @David, There is no DLL for SM.Media.MediaPlayer. But I some how found it and downloaded it from some blog. Though I have successfully added that DLL. It is saying StreamingMediaPlugin is not available but I can see it in Object Obrowser. I am new to this. Please helpElizabethelizabethan
W
2

@Mahesh Vemuri asked what if he has error that says StreamingMediaPlugin is not available or not found in namespace, here is my work around: XAML:

xmlns:PlayerFramework="using:Microsoft.PlayerFramework"


<PlayerFramework:MediaPlayer Name="player"
                    Source="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"
                    AudioCategory="BackgroundCapableMedia"
                    IsAudioSelectionVisible="True">
        <PlayerFramework:MediaPlayer.Plugins>
        </PlayerFramework:MediaPlayer.Plugins>
</PlayerFramework:MediaPlayer>

And in your .xaml.cs file you simply do this:

SM.Media.MediaPlayer.StreamingMediaPlugin asd = new SM.Media.MediaPlayer.StreamingMediaPlugin();
player.Plugins.Add(asd);
player.Source = new Uri("address-to-m3u8");

It worked for me since "default" way didn't. Hope it helps someone else, too.

Wick answered 19/5, 2015 at 22:41 Comment(3)
Yeah. Worked for me too. But, Now I am working on WInJS. SO I need HLS m3u8 support in video tag. IS there a any way to change the dll's and add to JS project so that M3U8 plays fine?Elizabethelizabethan
@MaheshVemuri Did you try VideoJS?Wick
I guess it will not work. VideoJS HLS works by using Flash Player. And Flash Player do not work on IE. So, Mostly Video JS and OSMF players donot work in mobile phone. I am not sure though. Its a rough guessElizabethelizabethan
H
0

you can add them from xaml or cs. First add reference.

  1. XAML

    xmlns:local="clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework"
    xmlns:smmedia="clr-namespace:SM.Media.MediaPlayer;assembly=SM.Media.MediaPlayer.WP8"
    
    
    <local:MediaPlayer Name="player"
                   HorizontalContentAlignment="Stretch"
                   AutoPlay="True"
                   Volume="0.7"
                   Source="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"
                   IsPlayPauseVisible="True">
        <local:MediaPlayer.Plugins>
            <smmedia:StreamingMediaPlugin />
        </local:MediaPlayer.Plugins>
    </local:MediaPlayer>
    
  2. XAML & CS

    xmlns:local="clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework"
    
    <local:MediaPlayer Name="player"
                   HorizontalContentAlignment="Stretch"
                   AutoPlay="True"
                   Volume="0.7"              
                   IsPlayPauseVisible="True">
    </local:MediaPlayer>
    
    
    SM.Media.MediaPlayer.StreamingMediaPlugin asd = new SM.Media.MediaPlayer.StreamingMediaPlugin();
    player.Plugins.Add(asd);
    player.Source = new Uri("http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8");
    
Horwath answered 6/12, 2015 at 5:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.