diff options
Diffstat (limited to 'stream/types/src')
| -rw-r--r-- | stream/types/src/lib.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/stream/types/src/lib.rs b/stream/types/src/lib.rs index 433b757..50227ec 100644 --- a/stream/types/src/lib.rs +++ b/stream/types/src/lib.rs @@ -139,13 +139,16 @@ pub enum StreamContainer { } impl StreamContainer { - pub fn mime_type(&self) -> &'static str { - match self { - Self::WebM => "video/webm", - Self::Matroska => "video/x-matroska", - Self::WebVTT => "text/vtt", - Self::JVTT => "application/jellything-vtt+json", - Self::MPEG4 => "video/mp4", + pub fn mime_type(&self, kind: TrackKind) -> &'static str { + match (self, kind) { + (Self::WebM, TrackKind::Audio) => "audio/webm", + (Self::WebM, _) => "video/webm", + (Self::Matroska, TrackKind::Audio) => "audio/x-matroska", + (Self::Matroska, _) => "video/x-matroska", + (Self::MPEG4, TrackKind::Audio) => "audio/mp4", + (Self::MPEG4, _) => "video/mp4", + (Self::WebVTT, _) => "text/vtt", + (Self::JVTT, _) => "application/jellything-vtt+json", } } } |