Skip to content

Commit

Permalink
Add audio media types
Browse files Browse the repository at this point in the history
follow up: hyperium#44
ref: hyperium#130
  • Loading branch information
MITSUBOSHI committed Aug 28, 2023
1 parent 938484d commit 9994b4f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
24 changes: 23 additions & 1 deletion mime-parse/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,24 @@ impl Atoms {
return Atoms::AUDIO_STAR;
}
},
3 => {
if sub == OGG {
return Atoms::AUDIO_OGG;
}
if sub == MP4 {
return Atoms::AUDIO_MP4;
}
}
4 => {
if sub == MPEG {
return Atoms::AUDIO_MPEG;
}
},
5 => {
if sub == BASIC {
return Atoms::AUDIO_BASIC;
}
},
_ => (),
}
}
Expand Down Expand Up @@ -467,6 +485,11 @@ mimes! {
APPLICATION_PDF, "application/pdf", 11;
APPLICATION_DNS, "application/dns-message", 11;

AUDIO_BASIC, "audio/basic", 5;
AUDIO_MPEG, "audio/mpeg", 5;
AUDIO_MP4, "audio/mp4", 5;
AUDIO_OGG, "audio/ogg", 5;

// media-ranges
//@ MediaRange:
STAR_STAR, "*/*", 1;
Expand All @@ -475,4 +498,3 @@ mimes! {
VIDEO_STAR, "video/*", 5;
AUDIO_STAR, "audio/*", 5;
}

6 changes: 5 additions & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ mimes! {
APPLICATION_PDF, "application/pdf";
APPLICATION_DNS, "application/dns-message";

AUDIO_BASIC, "audio/basic";
AUDIO_MPEG, "audio/mpeg";
AUDIO_MP4, "audio/mp4";
AUDIO_OGG, "audio/ogg";

// media-ranges
@ MediaRange:
STAR_STAR, "*/*";
Expand All @@ -118,4 +123,3 @@ mimes! {
VIDEO_STAR, "video/*";
AUDIO_STAR, "audio/*";
}

0 comments on commit 9994b4f

Please sign in to comment.