2using System.Collections.Generic;
4using System.Threading.Tasks;
93 if (ContentType.StartsWith(
"video/"))
115 public Task<object>
DecodeAsync(
string ContentType,
byte[] Data, Encoding Encoding, KeyValuePair<string, string>[] Fields, Uri BaseUri)
117 return Task.FromResult<
object>(Data);
128 switch (FileExtension.ToLower())
136 ContentType =
"video/mp4";
145 ContentType =
"video/mpeg";
149 ContentType =
"video/ogg";
154 ContentType =
"video/quicktime";
158 ContentType =
"video/webm";
163 ContentType =
"video/x-la-asf";
169 ContentType =
"video/x-ms-asf";
173 ContentType =
"video/x-msvideo";
177 ContentType =
"video/x-sgi-movie";
181 ContentType =
"video/3gpp";
185 ContentType =
"video/3gpp2";
189 ContentType =
"video/x-flv";
193 ContentType =
"video/x-wmv";
197 ContentType =
string.Empty;
210 switch (ContentType.ToLower())
213 FileExtension =
"mp4";
217 FileExtension =
"mpg";
221 FileExtension =
"ogv";
224 case "video/quicktime":
225 FileExtension =
"mov";
229 FileExtension =
"webm";
232 case "video/x-la-asf":
233 FileExtension =
"lsf";
236 case "video/x-ms-asf":
237 FileExtension =
"asf";
240 case "video/x-msvideo":
241 FileExtension =
"avi";
244 case "video/x-sgi-movie":
245 FileExtension =
"movie";
249 FileExtension =
"3gp";
253 FileExtension =
"3g2";
257 FileExtension =
"flv";
261 FileExtension =
"wmv";
265 FileExtension =
string.Empty;
Binary video decoder. Is used to identify video content, but does not have actual decoding of corresp...
static readonly string[] VideoFileExtensions
Video content types.
bool Decodes(string ContentType, out Grade Grade)
If the decoder decodes an object with a given content type.
VideoDecoder()
Binary video decoder. Is used to identify video content, but does not have actual decoding of corresp...
static readonly string[] VideoContentTypes
Video content types.
bool TryGetContentType(string FileExtension, out string ContentType)
Tries to get the content type of an item, given its file extension.
bool TryGetFileExtension(string ContentType, out string FileExtension)
Tries to get the file extension of an item, given its Content-Type.
string[] FileExtensions
Supported file extensions.
string[] ContentTypes
Supported content types.
Task< object > DecodeAsync(string ContentType, byte[] Data, Encoding Encoding, KeyValuePair< string, string >[] Fields, Uri BaseUri)
Decodes an object.
Basic interface for Internet Content decoders. A class implementing this interface and having a defau...