Infinite Loading

Topics: Windows 8 Xaml
May 15, 2013 at 7:12 PM
Greatings,

I'm trying to use the player, my code is the follow

<mmppf:MediaPlayer x:Name="player"
Source="http://www.fourideas.pt/4ideas/Museu/abegao.mp4"
                                           IsFullScreenVisible="True" AutoPlay="False" MediaFailed="player_MediaFailed_1"
                                       MediaLoading="player_MediaLoading_1" MediaOpened="player_MediaOpened_1" 
                                       MediaStarting="player_MediaStarting_1">
                    </mmppf:MediaPlayer>
the events code
private void player_MediaFailed_1(object sender, ExceptionRoutedEventArgs e)
    {

    }

    private void player_MediaLoading_1(object sender, MediaPlayerDeferrableEventArgs e)
    {
        Debug.WriteLine(((Microsoft.PlayerFramework.MediaPlayer)sender).BufferingProgress);
        ((Microsoft.PlayerFramework.MediaPlayer)sender).BufferingProgressChanged += VideoView_BufferingProgressChanged;
        ((Microsoft.PlayerFramework.MediaPlayer)sender).DownloadProgressChanged += VideoView_DownloadProgressChanged;
    }

    void VideoView_DownloadProgressChanged(object sender, RoutedEventArgs e)
    {
        Debug.WriteLine(((Microsoft.PlayerFramework.MediaPlayer)sender).DownloadProgress);
    }

    void VideoView_BufferingProgressChanged(object sender, RoutedEventArgs e)
    {
        Debug.WriteLine(((Microsoft.PlayerFramework.MediaPlayer)sender).BufferingProgress);
    }

    private void player_MediaOpened_1(object sender, RoutedEventArgs e)
    {

    }

    private void player_MediaStarting_1(object sender, MediaPlayerDeferrableEventArgs e)
    {

    }
I put breakpoints on all, and the only one that fire is the loading event.

After the loading event nothing happens, no downloadprogress, no bufferprogress, no mediafailed, i have nothing, just keeps loading.

Anyone have a solution or know what may cause this problem?

Thank you
Coordinator
May 17, 2013 at 6:01 PM
In your Xaml, I see you are setting AutoPlay="False". If you set this to true, you should see playback begin and MediaStarting will get raised.

If you set AutoPlay="False" on purpose, the MediaOpened event will still fire and from there or anytime after that you can call .Play(). After calling .Play(), MediaStarting will fire.

Hope this helps, let me know if I misunderstood what you are experiencing, Tim