Jplayer is a very useful html 5 music video player If you don't know, you can do it yourself Baidu Let's take a look at the detailed introduction and usage; By default, when playing the list of jplayer, if there is a play error, the player will stop playing and will not automatically skip to the next song, which will affect the user experience. Blueleaf looks at the document of jplayer and finds that there is an error in the function of error handling, but it will not skip to automatically enter the next song. If you want to make the list of jplayer play error automatically enter the next song, You can either modify the jplayer.js file or write a piece of jq code in the customized js file, and skip to the next song automatically when judging the playback error. Here is a simple method, see the code. This is the error handling code section. error: function(event){$(".jp-next").trigger("click");}
This is a complete list example. Please refer to the playlist in the jplayer source code for modification. $(document).ready(function(){ var myPlaylist = new jPlayerPlaylist({ jPlayer: "# jquery _jplayer_N", css SelectorAncestor: "#jp_container_N" }, [ { Title: "Music name", mp3:" http://www.jplayer.org/audio/mp3/TSP-01-Cro_magnon_man.mp3 " }, { Title: "Music name", mp3:" http://www.jplayer.org/audio/mp3/TSP-01-Cro_magnon_man.mp3 " } ],{ready:function(){$(this).jPlayer("play")}, error: function(event){$(".jp-next").trigger("click");}, swfPath: "../../ dist/jplayer", supplied: "mp3", useStateClassSkin: true, autoBlur: false, smoothPlayBar: true, keyEnabled: true, audioFullScreen: true }); });
Disclaimer:
Website: Click Copy to share with friends!
All content resources shared by this website, if not noted, are original by Blueleaf. If you need to reprint, please indicate the source; Please contact us in case of infringement Contact handling 。 Please understand!