Add support for raw AV1/Opus

This commit is contained in:
Zero 2020-11-18 02:17:59 -05:00 committed by Calvin Montgomery
parent 47d268335e
commit 9a008d4623
4 changed files with 11 additions and 4 deletions

View file

@ -29,7 +29,9 @@ natively. Accordingly, CyTube only supports a few codecs:
**Video** **Video**
* MP4 (AV1)
* MP4 (H.264) * MP4 (H.264)
* WebM (AV1)
* WebM (VP8) * WebM (VP8)
* WebM (VP9) * WebM (VP9)
* Ogg/Theora * Ogg/Theora

View file

@ -1,12 +1,13 @@
codecToMimeType = (codec) -> codecToMimeType = (codec) ->
switch codec switch codec
when 'mov/h264' then 'video/mp4' when 'mov/h264', 'mov/av1' then 'video/mp4'
when 'flv/h264' then 'video/flv' when 'flv/h264' then 'video/flv'
when 'matroska/vp8', 'matroska/vp9' then 'video/webm' when 'matroska/vp8', 'matroska/vp9', 'matroska/av1' then 'video/webm'
when 'ogg/theora' then 'video/ogg' when 'ogg/theora' then 'video/ogg'
when 'mp3' then 'audio/mp3' when 'mp3' then 'audio/mp3'
when 'vorbis' then 'audio/ogg' when 'vorbis' then 'audio/ogg'
when 'aac' then 'audio/aac' when 'aac' then 'audio/aac'
when 'opus' then 'audio/opus'
else 'video/flv' else 'video/flv'
window.FilePlayer = class FilePlayer extends VideoJSPlayer window.FilePlayer = class FilePlayer extends VideoJSPlayer

View file

@ -24,6 +24,7 @@ const SOURCE_CONTENT_TYPES = new Set([
'audio/aac', 'audio/aac',
'audio/ogg', 'audio/ogg',
'audio/mpeg', 'audio/mpeg',
'audio/opus',
'video/mp4', 'video/mp4',
'video/ogg', 'video/ogg',
'video/webm' 'video/webm'

View file

@ -80,13 +80,16 @@ var acceptedCodecs = {
"flv/h264": true, "flv/h264": true,
"matroska/vp8": true, "matroska/vp8": true,
"matroska/vp9": true, "matroska/vp9": true,
"ogg/theora": true "ogg/theora": true,
"mov/av1": true,
"matroska/av1": true
}; };
var acceptedAudioCodecs = { var acceptedAudioCodecs = {
"mp3": true, "mp3": true,
"vorbis": true, "vorbis": true,
"aac": true "aac": true,
"opus": true
}; };
var audioOnlyContainers = { var audioOnlyContainers = {