2012-11-27 59 views
0

我希望我的應用程序中播放(.m3u8)直播,我發現這個例子 http://archive.msdn.microsoft.com/SmoothStreaming/Release/ProjectReleases.aspx?ReleaseId=3867SmoothStreamingMediaElement(.m3u8)在Windows手機

它與其他的鏈接,但如果我盡我.m3u8掛靠不起作用。 在windows phone中播放這種類型的流是否有特定的方法?

 public MainPage() 
{ 

     InitializeComponent(); 
     SupportedOrientations = SupportedPageOrientation.Landscape; 
     Loaded += new RoutedEventHandler(MainPage_Loaded); 
     phoneApplicationPage.ManipulationStarted += new EventHandler<ManipulationStartedEventArgs>(phoneApplicationPage_ManipulationStarted); 
     phoneApplicationPage.ManipulationCompleted += new EventHandler<ManipulationCompletedEventArgs>(phoneApplicationPage_ManipulationCompleted); 
     seekbar.MouseLeftButtonUp += new MouseButtonEventHandler(seekbar_MouseLeftButtonUp); 

     List<Content> Contents = new List<Content>(); 
     Contents.Add(new Content("Media One", new Uri("http://fl1.viastreaming.net/iqraatv2/livestream/playlist.m3u8"))); 
     Contents.Add(new Content("Media Two", new Uri("http://Media_Two.ism/manifest"))); 
    Contents.Add(new Content("Media Three", new Uri("http://Media_Three.ism/manifest"))); 
     Contents.Add(new Content("Media Four", new Uri("http://Media_Four.ism/manifest"))); 

     comboBoxUrls.ItemsSource = Contents; 
     comboBoxUrls.SelectedIndex = 0; 
     comboBoxUrls.SelectionChanged += new SelectionChangedEventHandler(comboBoxUrls_SelectionChanged); 
    } 
+0

http://stackoverflow.com/questions/27005883/playing-hls-m3u8-playlist-on-windows-phone-8-1/27026663#27026663 –

回答

0

這工作完美。 Playing HLS (m3u8 playlist) on Windows Phone 8.1 下載播放器框架,消耗以下DLL的:

DLL's to consume

玩家添加到您的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> 

然後設置您的流通過代碼 - 或XAML如果URL永遠不會改變。