pupunzi / jquery.mb.miniAudioPlayer

an HTML5 / jQuery audioplayer (mp3 / ogg)
73 stars 28 forks source link

mb_miniPlayer_changeFile search for 'length' #18

Open milkotodorov opened 4 years ago

milkotodorov commented 4 years ago

Hello,

using the mb_miniPlayer_changeFile throws the following exception:

jquery.js?ver=1.12.4-wp:2 Uncaught TypeError: Cannot use 'in' operator to search for 'length' in http://www.miaowmusic.com/mp3/Miaow-04-Lismore.mp3
    at s (jquery.js?ver=1.12.4-wp:2)
    at Function.each (jquery.js?ver=1.12.4-wp:2)
    at a.jPlayer._absoluteMediaUrls (jquery.mb.miniAudioPlayer.min.js?ver=1.9.3:10)
    at a.jPlayer.setMedia (jquery.mb.miniAudioPlayer.min.js?ver=1.9.3:10)
    at HTMLDivElement.<anonymous> (jquery.mb.miniAudioPlayer.min.js?ver=1.9.3:9)
    at Function.each (jquery.js?ver=1.12.4-wp:2)
    at a.fn.init.each (jquery.js?ver=1.12.4-wp:2)
    at a.fn.init.a.fn.jPlayer (jquery.mb.miniAudioPlayer.min.js?ver=1.9.3:9)
    at a.fn.init.changeFile [as mb_miniPlayer_changeFile] (jquery.mb.miniAudioPlayer.min.js?ver=1.9.3:8)
    at HTMLButtonElement.onclick ((index):432)

I just test it with a simple example button

<button onclick="$('#mbmaplayer_1').mb_miniPlayer_changeFile('http://www.miaowmusic.com/mp3/Miaow-04-Lismore.mp3',false,'Lismore (mp3)')">Lismore (mp3)</button>
achilehero commented 2 years ago

Hello!

By looking at the function signature, looks like it was changed, but the documentation is not up to date. So now it is something like: changeFile: function (media, title). In that case you can use it like: $('#mbmaplayer_1').mb_miniPlayer_changeFile({mp3: 'http://www.miaowmusic.com/mp3/Miaow-04-Lismore.mp3'},false)"