private void ChunkDownloadManager_ChunkDownloadExceededMaximumRetryAttempts(ChunkDownloadManager chunkDownloadManager, TrackInfo mediaTrack, TimeSpan chunkTimestamp) { //SendLogEntry(KnownLogEntryTypes.SmoothStreamingMediaElementDownloadExceededMaximumRetryAttempts, LogLevel.Error); if (DownloadStreamDataFailed != null) { DownloadStreamDataFailed(this, mediaTrack, null, new TimeoutException()); } }
/// <summary> /// Initializes the smooth streaming media element. /// </summary> /// <param name="ssme">The instance of the SmoothStreamingMediaElement to use</param> public void Initialize(SmoothStreamingMediaElement ssme) { SSME = ssme; if (downloaderPlugin != null) { SSME.SmoothStreamingCache = new DownloaderPluginAdapter(downloaderPlugin); } #if !WINDOWS_PHONE _chunkDownloadManager = new ChunkDownloadManager(SSME); _chunkDownloadManager.DownloadCompleted += ChunkDownloadManager_ChunkDownloadCompleted; _chunkDownloadManager.RetryingDownload += ChunkDownloadManager_RetryingChunkDownload; _chunkDownloadManager.DownloadExceededMaximumRetries += ChunkDownloadManager_ChunkDownloadExceededMaximumRetryAttempts; #endif WireSmoothEvents(); }
private void ChunkDownloadManager_ChunkDownloadCompleted(ChunkDownloadManager downloadManager, TrackInfo track, TimeSpan timestamp, ChunkResult result) { var dataChunk = track.Stream.ChunkList.First(i => i.TimeStamp == timestamp); if (result.Result == ChunkResult.ChunkResultState.Succeeded) { OnDownloadStreamDataCompleted(track, dataChunk, result.ChunkData, track.Stream); if (DownloadStreamDataCompleted != null) { DownloadStreamDataCompleted(this, track, dataChunk, result.ChunkData, track.Stream); } } else { if (DownloadStreamDataFailed != null) { DownloadStreamDataFailed(this, track, dataChunk, result.Error); } } }
private void ChunkDownloadManager_RetryingChunkDownload(ChunkDownloadManager chunkDownloadManager, TrackInfo mediaTrack, TimeSpan chunkTimestamp) { //SendLogEntry(KnownLogEntryTypes.SmoothStreamingMediaElementDownloadRetry); }
private void ChunkDownloadManager_ChunkDownloadExceededMaximumRetryAttempts(ChunkDownloadManager chunkDownloadManager, TrackInfo mediaTrack, TimeSpan chunkTimestamp) { //SendLogEntry(KnownLogEntryTypes.SmoothStreamingMediaElementDownloadExceededMaximumRetryAttempts, LogLevel.Error); if (DownloadStreamDataFailed != null) DownloadStreamDataFailed(this, mediaTrack, null, new TimeoutException()); }
private void ChunkDownloadManager_ChunkDownloadCompleted(ChunkDownloadManager downloadManager, TrackInfo track, TimeSpan timestamp, ChunkResult result) { var dataChunk = track.Stream.ChunkList.First(i => i.TimeStamp == timestamp); if (result.Result == ChunkResult.ChunkResultState.Succeeded) { OnDownloadStreamDataCompleted(track, dataChunk, result.ChunkData, track.Stream); if (DownloadStreamDataCompleted != null) DownloadStreamDataCompleted(this, track, dataChunk, result.ChunkData, track.Stream); } else { if (DownloadStreamDataFailed != null) DownloadStreamDataFailed(this, track, dataChunk, result.Error); } }