From d21943ecc7294f86f61af483b9aed2d955d9abfe Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sat, 17 Dec 2016 19:53:17 -0800 Subject: [PATCH] Whitelist m4a/aac for ffmpeg --- package.json | 2 +- player/raw-file.coffee | 1 + src/ffmpeg.js | 3 ++- www/js/player.js | 2 ++ www/js/ui.js | 2 +- www/js/util.js | 5 +++-- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 78a0a026..f0099b72 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/player/raw-file.coffee b/player/raw-file.coffee index 8053cd9c..1b036e2b 100644 --- a/player/raw-file.coffee +++ b/player/raw-file.coffee @@ -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 diff --git a/src/ffmpeg.js b/src/ffmpeg.js index 1631d22e..828bb5d6 100644 --- a/src/ffmpeg.js +++ b/src/ffmpeg.js @@ -20,7 +20,8 @@ var acceptedCodecs = { var acceptedAudioCodecs = { "mp3": true, - "vorbis": true + "vorbis": true, + "aac": true }; var audioOnlyContainers = { diff --git a/www/js/player.js b/www/js/player.js index f38af96a..403e0a65 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -733,6 +733,8 @@ return 'audio/mp3'; case 'vorbis': return 'audio/ogg'; + case 'aac': + return 'audio/aac'; default: return 'video/flv'; } diff --git a/www/js/ui.js b/www/js/ui.js index 83c66ae4..d154583a 100644 --- a/www/js/ui.js +++ b/www/js/ui.js @@ -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) { diff --git a/www/js/util.js b/www/js/util.js index ef6a41cd..c29ab2d0 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -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"); } }