コード例 #1
0
 private void StreamSelectionManager_StreamSelectionExceededMaximumRetries(StreamSelectionManager streamSelectionManager, SegmentInfo segment, IEnumerable <StreamInfo> streams)
 {
     if (StreamSelectionFailed != null)
     {
         StreamSelectionFailed(this, streams, new TimeoutException());
     }
 }
コード例 #2
0
        private void OpenManifest()
        {
#if !WINDOWS_PHONE
            SSME.ManifestInfo.ChunkListChanged += ManifestInfo_ChunkListChanged;
#endif
            _streamSelectionManager = new StreamSelectionManager(SSME.ManifestInfo);
            _streamSelectionManager.StreamSelectionCompleted += StreamSelectionManager_StreamSelectionCompleted;
            _streamSelectionManager.StreamSelectionExceededMaximumRetries += StreamSelectionManager_StreamSelectionExceededMaximumRetries;
        }
コード例 #3
0
        private void StreamSelectionManager_StreamSelectionCompleted(StreamSelectionManager streamSelectionManager, SegmentInfo segment, IEnumerable <StreamInfo> streams, StreamUpdatedListEventArgs e)
        {
            if (e.Error == null)
            {
                foreach (StreamUpdatedEventArgs update in e.StreamUpdatedEvents)
                {
                    if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamSelected)
                    {
                        var stream = update.Stream;
#if !WINDOWS_PHONE
                        if ((stream.GetStreamType().ToLower() == "binary" || stream.GetStreamType().ToLower() == "text") && stream.AvailableTracks.Any())
                        {
                            var track = stream.AvailableTracks.First();
                            DownloadStreamData(track);
                        }
#endif
                        if (StreamSelected != null)
                        {
                            StreamSelected(this, stream);
                        }
                    }
                    else if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamDeselected)
                    {
                        var stream = update.Stream;
#if !WINDOWS_PHONE
                        if ((stream.GetStreamType().ToLower() == "binary" || stream.GetStreamType().ToLower() == "text") && stream.AvailableTracks.Any())
                        {
                            var track = stream.AvailableTracks.First();
                            CancelDownloadStreamData(track);
                        }
#endif
                        if (StreamUnselected != null)
                        {
                            StreamUnselected(this, update.Stream);
                        }
                    }
                }
            }
            else
            {
                if (StreamSelectionFailed != null)
                {
                    StreamSelectionFailed(this, streams, e.Error);
                }
            }
        }
コード例 #4
0
 private void StreamSelectionManager_StreamSelectionExceededMaximumRetries(StreamSelectionManager streamSelectionManager, SegmentInfo segment, IEnumerable<StreamInfo> streams)
 {
     if (StreamSelectionFailed != null) StreamSelectionFailed(this, streams, new TimeoutException());
 }
コード例 #5
0
        private void StreamSelectionManager_StreamSelectionCompleted(StreamSelectionManager streamSelectionManager, SegmentInfo segment, IEnumerable<StreamInfo> streams, StreamUpdatedListEventArgs e)
        {
            if (e.Error == null)
            {
                foreach (StreamUpdatedEventArgs update in e.StreamUpdatedEvents)
                {
                    if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamSelected)
                    {
                        var stream = update.Stream;
#if !WINDOWS_PHONE
                        if ((stream.GetStreamType().ToLower() == "binary" || stream.GetStreamType().ToLower() == "text") && stream.AvailableTracks.Any())
                        {
                            var track = stream.AvailableTracks.First();
                            DownloadStreamData(track);
                        }
#endif
                        if (StreamSelected != null) StreamSelected(this, stream);
                    }
                    else if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamDeselected)
                    {
                        var stream = update.Stream;
#if !WINDOWS_PHONE
                        if ((stream.GetStreamType().ToLower() == "binary" || stream.GetStreamType().ToLower() == "text") && stream.AvailableTracks.Any())
                        {
                            var track = stream.AvailableTracks.First();
                            CancelDownloadStreamData(track);
                        }
#endif
                        if (StreamUnselected != null) StreamUnselected(this, update.Stream);
                    }
                }
            }
            else
            {
                if (StreamSelectionFailed != null) StreamSelectionFailed(this, streams, e.Error);
            }
        }
コード例 #6
0
        private void OpenManifest()
        {
#if !WINDOWS_PHONE
            SSME.ManifestInfo.ChunkListChanged += ManifestInfo_ChunkListChanged;
#endif
            _streamSelectionManager = new StreamSelectionManager(SSME.ManifestInfo);
            _streamSelectionManager.StreamSelectionCompleted += StreamSelectionManager_StreamSelectionCompleted;
            _streamSelectionManager.StreamSelectionExceededMaximumRetries += StreamSelectionManager_StreamSelectionExceededMaximumRetries;
        }