public void HeaderFiltering(MediaQueryContext query, MediaHeaderContext header) { // Build a temporary source to test formats var testSource = new MediaSource() { Url = header.LocationContext.Location, TimeStamp = header.TimeStamp }; testSource.Metadata["ContentLength"] = header.ContentLength.ToString(); testSource.Metadata["MimeType"] = header.ContentType; testSource.Metadata["Title"] = header.Title; testSource.Metadata["SourceName"] = HeaderName; var testContext = new MediaSourceContext(testSource) { Stream = header.LocationContext.Stream }; var formats = _gardenService.Value.MatchFormats(testContext,query.MediaStereotype).ToList(); // Match a format, add it to sources if (formats.Any()) { testContext.Formats = formats; var format = formats.First(); testSource.MediaStereotype = format.MediaStereotype; testSource.FormatName = format.FormatName; query.Sources.Add(testContext); } else { // Helpful message for debugging sources that don't work :) Services.Notifier.Warning(T("No matching media formats found at {0} (with MIME type '{1}' and file extension '{2}')", testSource.Url, testSource.Metadata["MimeType"], testSource.FileExtension() )); } }
public void HeaderFiltered(MediaQueryContext query, MediaHeaderContext header) { }