Whitelist m4a/aac for ffmpeg

This commit is contained in:
Calvin Montgomery 2016-12-17 19:53:17 -08:00
parent 041d50cb23
commit d21943ecc7
6 changed files with 10 additions and 5 deletions

View file

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "3.25.0",
"version": "3.25.1",
"repository": {
"url": "http://github.com/calzoneman/sync"
},

View file

@ -6,6 +6,7 @@ codecToMimeType = (codec) ->
when 'ogg/theora' then 'video/ogg'
when 'mp3' then 'audio/mp3'
when 'vorbis' then 'audio/ogg'
when 'aac' then 'audio/aac'
else 'video/flv'
window.FilePlayer = class FilePlayer extends VideoJSPlayer

View file

@ -20,7 +20,8 @@ var acceptedCodecs = {
var acceptedAudioCodecs = {
"mp3": true,
"vorbis": true
"vorbis": true,
"aac": true
};
var audioOnlyContainers = {

View file

@ -733,6 +733,8 @@
return 'audio/mp3';
case 'vorbis':
return 'audio/ogg';
case 'aac':
return 'audio/aac';
default:
return 'video/flv';
}

View file

@ -446,7 +446,7 @@ $("#mediaurl").keyup(function(ev) {
queue("end", "url");
} else {
var url = $("#mediaurl").val().split("?")[0];
if (url.match(/^https?:\/\/(.*)?\.(flv|mp4|og[gv]|webm|mp3|mov)$/) ||
if (url.match(/^https?:\/\/(.*)?\.(flv|mp4|og[gv]|webm|mp3|mov|m4a)$/) ||
url.match(/^fi:/)) {
var title = $("#addfromurl-title");
if (title.length === 0) {

View file

@ -1426,7 +1426,7 @@ function parseMediaLink(url) {
/* Raw file */
var tmp = url.split("?")[0];
if (tmp.match(/^https?:\/\//)) {
if (tmp.match(/\.(mp4|flv|webm|og[gv]|mp3|mov)$/)) {
if (tmp.match(/\.(mp4|flv|webm|og[gv]|mp3|mov|m4a)$/)) {
return {
id: url,
type: "fi"
@ -1435,8 +1435,9 @@ function parseMediaLink(url) {
Callbacks.queueFail({
link: url,
msg: "The file you are attempting to queue does not match the supported " +
"file extensions mp4, flv, webm, ogg, ogv, mp3, mov."
"file extensions mp4, flv, webm, ogg, ogv, mp3, mov, m4a."
});
// Lol I forgot about this hack
throw new Error("ERROR_QUEUE_UNSUPPORTED_EXTENSION");
}
}