diff --git a/airtime_mvc/application/controllers/AudiopreviewController.php b/airtime_mvc/application/controllers/AudiopreviewController.php index 6e579045c..69b82939e 100644 --- a/airtime_mvc/application/controllers/AudiopreviewController.php +++ b/airtime_mvc/application/controllers/AudiopreviewController.php @@ -184,6 +184,7 @@ class AudiopreviewController extends Zend_Controller_Action 'element_artist' => isset($track['artist_name'])?$track['artist_name']:"", 'element_id' => isset($track['id'])?$track['id']:"", 'element_position' => isset($track['position'])?$track['position']:"", + 'mime' => isset($track['mime'])?$track['mime']:"" ); /* If the track type is static we know it must be diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index e227ff403..71a356aa5 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1095,7 +1095,8 @@ class Application_Model_Preference public static function getCurrentLibraryTableSetting() { $v = self::getValue("library_datatable"); - if( $v === '' ) { + + if ( $v === '' ) { return function ($x) { return $x; }; } else { $ds = unserialize($v); diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 6e61dba97..de81f04f7 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -782,7 +782,10 @@ SQL; $media_id = $item['stream_id']; $uri = $item['url']; self::createStreamScheduleEvent($data, $item, $media_id, $uri); + } else { + throw new Exception("Unknown schedule type: ".print_r($item, true)); } + } } diff --git a/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js b/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js index b1c90dbf3..a1d604f41 100644 --- a/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js +++ b/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js @@ -143,7 +143,7 @@ function buildplaylist(p_url, p_playIndex) { mp3:data[index]['uri'] }; } - if (media) { + if (media && isAudioSupported(data[index]['mime'])) { myPlaylist[index] = media; } // we should create a map according to the new position in the 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); }