add new chunks in current chunk list

Oct 4, 2012 at 12:06 PM
Edited Oct 4, 2012 at 12:17 PM

Hello,

How to add new chunks in the currently playing chunk list?

Below is what I tried. But it throws an error (on selectedStreamsChunkList.Add(chunkInfo); ) "Collection is readonly". This collection is readonly from the "Microsoft.Web.Media.SmoothStreaming.dll".

Also is there any way to do this? I am doing this to play the replay of the game. I used the "ScheduleAdvertisement" to play the replay but once the Advertisement gets completed we can not play it again by seek back on before or same position of the replay.

 

So I need such a way to play the live game with replays. I want to add the new chunks at runtime.

 

SmoothStreamingMediaElement ssme = (SmoothStreamingMediaElement)Player.ActiveMediaPlugin.VisualElement;

 //Get AvailableStreams
                            var manifestInfo = mediaElement.ManifestInfo;


//Get the segments
                            foreach (var segments in manifestInfo.Segments)
                            {
                                if (segments.AvailableStreams != null)
                                {
                                    //Get the Audio and Video streams
                                    foreach (var selectedStreams in segments.SelectedStreams)
                                    {
                                        //Get the videos selected tracks
                                        if (selectedStreams.Type == MediaStreamType.Video)
                                        {
                                            segments.SelectedStreams.Add(selectedStreams);

                                            var selectedStreamsChunkList = selectedStreams.ChunkList;

                                            //try to add the new chunk in the current chunk list
                                            var chunkInfo = selectedStreamsChunkList[0];

                                            try
                                            {
                                                selectedStreamsChunkList.Add(chunkInfo);
                                            }
                                            catch (Exception exception)
                                            {
                                                Console.WriteLine(exception.Message);
                                            }


                                          
                                        }
                                    }

                                }
                            }