]> git.parisson.com Git - telemeta.git/commitdiff
Fix compatibility format
authormaths28 <mathieu.boye28@gmail.com>
Sun, 22 May 2016 13:49:27 +0000 (15:49 +0200)
committermaths28 <mathieu.boye28@gmail.com>
Sun, 22 May 2016 13:49:27 +0000 (15:49 +0200)
FIx compatibility by change format of file resource to "ogg" instead of "mp3" when an error occurs
 in an old browser like in my case Firefox 28.0

telemeta/static/telemeta/js/playlist.js

index b6427cf6b467870a37a0094ee585332d9aba426c..f7e2da0924b75a9027083846c801c4300c3a0eba 100644 (file)
@@ -89,7 +89,13 @@ var playlistUtils = {
     },
 
     loadSong: function(resElem){
-        var audio = new Audio(resElem);
+        var audio = new Audio();
+       //For old browsers that do not support mp3 files 
+        audio.onerror = function(){
+             this.src = this.src.replace("mp3", "ogg");
+             this.play();
+       };
+       audio.src = resElem;
         audio.play();
     },