From b04afaec2c4883d26945febcfe467c921e8077d8 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 13 Sep 2012 14:55:17 -0400 Subject: [PATCH] CC-4393: Please ignore Flac items for Playlist Preview and disable to preview it as a single track -detect flash fallback --- airtime_mvc/public/js/airtime/common/audioplaytest.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/common/audioplaytest.js b/airtime_mvc/public/js/airtime/common/audioplaytest.js index aa9b8917b..76bc5d7c1 100644 --- a/airtime_mvc/public/js/airtime/common/audioplaytest.js +++ b/airtime_mvc/public/js/airtime/common/audioplaytest.js @@ -9,5 +9,10 @@ function isAudioSupported(mime){ bMime = mime; } - return !!bMime && !!audio.canPlayType && audio.canPlayType(bMime) != ""; + //return a true of the browser can play this file natively, or if the + //file is an mp3 and flash is installed (jPlayer will fall back to flash to play mp3s). + //Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative + //is adding a javascript library to do the work for you, which seems like overkill.... + return (!!audio.canPlayType && audio.canPlayType(bMime) != "") || + (mime.indexOf("mp3") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined); }