locked
MediaFailed while playing smoothstreaming video RRS feed

  • Question

  •  

    XAML

    <Canvas HorizontalAlignment="Left" VerticalAlignment="Top" >
                                    <mmppf:MediaPlayer x:Name="videoMediaElement"  Width="470"  Height="325"  IsSignalStrengthVisible="True"
                                                   HorizontalAlignment="Left" VerticalAlignment="Bottom"  IsGoLiveVisible="True"
                                                   AutoHide="False" IsFullScreen="False" IsFullScreenVisible="True" 
                                                   IsFullScreenChanged="fullScreenChanged"  MediaOpened="videoMediaElement_MediaOpened_1" MediaFailed="videoMediaElement_MediaFailed_1" MediaClosed="videoMediaElement_MediaClosed_1">
                                    </mmppf:MediaPlayer>
                                </Canvas>

    CS

    Static Main()

    {

    videoMediaElement.Plugins.Add(new Microsoft.PlayerFramework.Adaptive.AdaptivePlugin());

    }

    VideoPlayMethod(string currentVideoUrl)

    {

        try
                {

    videoMediaElement.Stop();

                    videoMediaElement.Plugins.Add(new Microsoft.PlayerFramework.Adaptive.AdaptivePlugin());
                    videoMediaElement.Source = new Uri(currentVideoUrl);
                }
                catch { }

    }

    I have got list of Video items. For the first time the video plays fine but when I tried to play other items of the list I get an error "The video failed to play. Retry" and of Course the Media Failed event is triggered. After that I am not able to play any of the video items. I tried the following after media failed....Did'nt worked.

     private void videoMediaElement_MediaFailed_1(object sender, ExceptionRoutedEventArgs e)
            {                                 
                videoMediaElement = null;
                videoMediaElement = new MediaPlayer();
                videoMediaElement.Width = 470;
                videoMediaElement.Height = 325;
                videoMediaElement.IsSignalStrengthVisible = true;
                videoMediaElement.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
                videoMediaElement.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Bottom;
                videoMediaElement.IsGoLiveVisible = true;
                videoMediaElement.AutoHide = false;
                videoMediaElement.IsFullScreen = false;
                videoMediaElement.IsFullScreenVisible = true;
                videoMediaElement.IsFullScreenChanged += fullScreenChanged;
                videoMediaElement.MediaOpened += videoMediaElement_MediaOpened_1;
                videoMediaElement.MediaFailed += videoMediaElement_MediaFailed_1;
                videoMediaElement.MediaClosed += videoMediaElement_MediaClosed_1;

               VideoPlayMethod(VideoUrl);

    }

    Please Suggest me the solutions....THANKS


    Thursday, October 24, 2013 3:52 PM

All replies

  • Xaml

    <Canvas HorizontalAlignment="Left" VerticalAlignment="Top" >
                                    <mmppf:MediaPlayer x:Name="videoMediaElement"  Width="470"  Height="325"  IsSignalStrengthVisible="True"
                                                   HorizontalAlignment="Left" VerticalAlignment="Bottom"  IsGoLiveVisible="True"
                                                   AutoHide="False" IsFullScreen="False" IsFullScreenVisible="True" 
                                                   IsFullScreenChanged="fullScreenChanged"  MediaOpened="videoMediaElement_MediaOpened_1" MediaFailed="videoMediaElement_MediaFailed_1" MediaClosed="videoMediaElement_MediaClosed_1">
                                    </mmppf:MediaPlayer>
    </Canvas>

    cs 

    Static Main()

    {

     videoMediaElement.Plugins.Add(new Microsoft.PlayerFramework.Adaptive.AdaptivePlugin());

    }

    VideoPlayMethod(string currentVideoUrl)

    {

        try
                {
                    videoMediaElement.Stop();

                    videoMediaElement.Source = new Uri(currentVideoUrl);

                }

                catch { }

    }

    I have List of Videos.

    For the First Time the video plays fine but when  try to play some other item from the list I get error "The Video failed to Play. Try Again" and then it ofcourse run into MediaFailed method. After that I am not able to play any videos from that list even the one which played initially. In Media failed method I tried to to do the following.....Did'nt worked

    private void videoMediaElement_MediaFailed_1(object sender, ExceptionRoutedEventArgs e)
            {                                 
                videoMediaElement = null;
                videoMediaElement = new MediaPlayer();
                videoMediaElement.Width = 470;
                videoMediaElement.Height = 325;
                videoMediaElement.IsSignalStrengthVisible = true;
                videoMediaElement.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
                videoMediaElement.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Bottom;
                videoMediaElement.IsGoLiveVisible = true;
                videoMediaElement.AutoHide = false;
                videoMediaElement.IsFullScreen = false;
                videoMediaElement.IsFullScreenVisible = true;
                videoMediaElement.IsFullScreenChanged += fullScreenChanged;
                videoMediaElement.MediaOpened += videoMediaElement_MediaOpened_1;
                videoMediaElement.MediaFailed += videoMediaElement_MediaFailed_1;
                videoMediaElement.MediaClosed += videoMediaElement_MediaClosed_1;

                try
                {
                    videoMediaElement.Plugins.Add(new Microsoft.PlayerFramework.Adaptive.AdaptivePlugin());
                    videoMediaElement.Source = new Uri(currentVideoUrl);
                }
                catch { }

    }

    Please Suggest me the solutions.......THANKS 

    Thursday, October 24, 2013 3:37 PM
  • Hello Sunil,

    What is the error returned by the media failed event?

    -James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Friday, October 25, 2013 10:50 PM
    Moderator
  • Hello James,

    Its not throwing any kind of error. simply run out for the event media failed

    Thursday, November 7, 2013 7:11 AM
  • Hello Sunil,

    I"m not sure I understand. Can you create a small Visual Studio sample that reproduces the problem and upload it to your SkyDrive account so I can take a look and reproduce the issue on my side?

    Once you have the project zipped up and uploaded please post a link here.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Friday, November 8, 2013 1:23 AM
    Moderator
  • Hello James,

    Please find the Smooth Streaming sample with the issue @ 

    https://skydrive.live.com/redir?resid=63BF742A8BCAA0F7!110&authkey=!ADPTyUAzvwycZLc

    Thanks,

    Sunil

    Friday, November 8, 2013 9:54 AM
  • Hello Sunil,

    Sorry for the very late reply. I have it on my schedule to look into this for you more closely next week.

    Thanks for your patience,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Saturday, November 16, 2013 12:19 AM
    Moderator
  • Hello,

    Unfortunately with the US holiday I will not be able to look at this until next week. Very sorry for the delay.

    -James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, November 27, 2013 10:57 PM
    Moderator
  • Its ok not an issue.
    Thursday, July 24, 2014 12:17 PM