private void StreamSelectionManager_StreamSelectionExceededMaximumRetries(StreamSelectionManager streamSelectionManager, SegmentInfo segment, IEnumerable <StreamInfo> streams) { if (StreamSelectionFailed != null) { StreamSelectionFailed(this, streams, new TimeoutException()); } }
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; }
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); } } }
private void StreamSelectionManager_StreamSelectionExceededMaximumRetries(StreamSelectionManager streamSelectionManager, SegmentInfo segment, IEnumerable<StreamInfo> streams) { if (StreamSelectionFailed != null) StreamSelectionFailed(this, streams, new TimeoutException()); }
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); } }