Skip to main content
Home Forums Silverlight Design Video and Media OnDemand live stream switching?
4 replies. Latest Post by groatsey on June 24, 2009.
(0)
groatsey
Member
1 points
11 Posts
06-18-2009 11:37 AM |
I need OnDemand Silverlight 2.0 clients to switch between 2 live streams.
I am using Server 2008 Enterprise Edition and MS Expression encoder to create two live push Broadcasts mms://server/SLLiveStream1 and mms://server/SLLiveStream2.
So far I have the Silverlight clients programmatically creating their own 'unique OnDemand Publishing Points which point to their own 'unique playlists':
<?wsx version="1.0"?><smil> <media id = "1" src="http://server:49000/SLLiveStream1"/> <media id = "2" src="http://server:49000/SLLiveStream2"/></smil>
I've been trying many ways to achieve this, without success.
Any help would be greatfully appreciated.
Thanks
Jamie.
gillesk
302 points
66 Posts
06-22-2009 11:39 AM |
If I understand correctly, you want a client to be able to switch between two publishing points. This should be very easy and straight forward. The simplest way is to set the source of your MediaElement to the stream that you want whenever the user switches. This will cause the MediaElement to reset and switch stream, but will glitch. The other way, would be to use 2 media elements. While the first one is playing, you can hide and mute the second one, start connecting to the second stream, when you hit the MediaOpened event, you can then mute, hide and reset the first media element and show and unhide the second media element. This will glitchless, but for a short period of time you will use the bandwidth for both streams.
06-23-2009 4:41 AM |
Thanks for the reply!
I was trying to follow the 'seamlessly switching' of Silverlight Server-Side Playlists described on MSDN: http://msdn.microsoft.com/en-us/library/cc645037(VS.95).aspx
If I could 'edit the playlist even while a client is viewing a stream identified by the playlist' i.e. swap between http://server:49000/SLLiveStream1 and http://server:49000/SLLiveStream2 without glitches then that would be great.
I have tried the following without success:
IWMSPlaylist.FireEvent http://msdn.microsoft.com/en-us/library/ms740339(VS.85).aspxIWMSPlaylist.CurrentPlaylistEntry http://msdn.microsoft.com/en-us/library/ms740337.aspx
Could you confirm that using the Server Object / IWMSPlaylist Object should achieve my objective above? If so, could you tell me if there is a minimum time that a clip duration should last, to ensure seamless switching?
06-23-2009 11:49 AM |
That could work, I've haven't tried it though. You will most likely need to have a webservice running on the server to handle the playlist change since you can't get to the IWMSPlaylist object from Silverlight directly.
06-24-2009 5:23 AM |
Thanks.
I have a webservice in place to handle the playlist change, as you suggested, however, I experiencing some issues with stream change responsiveness.To isolate this issue I have a simple test project which points to an OnDemand publishing point which in turn points to the playlist (below).
The xaml media element points to this (<MediaElement x:Name="VideoElement" Source="mms://server:49000/testODPP" BufferingTime="00:00:00.000"/>)
<?wsx version="1.0"?><smil> <seq id="sq1"> <media id = "1" src="http://server:49000/SLLiveStream1" dur="2" begin="0"/> <media id = "2" src="http://server:49000/SLLiveStream2" dur="2"/> <media id = "3" src="http://server:49000/SLLiveStream1" dur="2"/> <media id = "4" src="http://server:49000/SLLiveStream2" dur="2"/> </seq></smil>
The first media item plays for 2 seconds in the Silverlight 2.0 player, however, the following media items linger for up to 8 seconds each.
Is it possible I am missing some live streaming buffer configuration settings or other?
Jamie