How to add Live Smooth Streaming via code

Jan 29, 2012 at 10:51 PM

Hi all, I have a simple app I am working on that will try to play a Live Smooth Streaming via code since the URL of the Live Stream will be generated on the fly. My problem is that I can get this to work by simply putting in the URL into the XAML and running but when I try to add the code below I get a blank screen and the error "3222 An error has occurred."

the code I am using to get my media URL is from the initParams. It works as expected. The part that does not work is when I create a PlaylistItem in code and then assign it to the PlayList and try to play the video.

        void ThePlayer_Loaded(object sender, RoutedEventArgs e)
        {
            pliLiveSmooth.MediaSource = new Uri(App.SLVP_MediaUrl, UriKind.Absolute);
            pliLiveSmooth.DeliveryMethod = DeliveryMethods.AdaptiveStreaming;
            ThePlayer.Playlist.Add(pliLiveSmooth);
            ThePlayer.Play();
        }

Any ideas what I am doing wrong?

My sample Live stream is located at http://wsp.1C27.edgecastcdn.net/211C27/test1.isml/Manifest

thanks