jPlayer multi-video demo code?

此生再无相见时 提交于 2019-12-24 10:58:01

问题


I'm just learning jPlayer. Love how versatile it is, choosing the appropriate format for each system it runs on. Is there any multi-video demo code, either from HappyWorm or third party, that I should be aware of?

I'd like to create a player for multiple videos like this:

P.S. If you'd like to help me out on a maximize issue while in an iframe, please do so here: jPlayer fullscreen while inside IFRAME?


回答1:


listItem += "<a href='javascript:;' class='" + this.options.playlistOptions.itemClass + "' tabindex='1'><img src='" + media.thumb + " ' />" + media.title +  (media.artist ? " <br /><span class='jp-artist'>by " + media.artist + "</span>" : "") + "</a>";

added a new parameter 'thumb' in de html file ...




回答2:


First, go to the jplayer.org download page and get the source files for 2.1. From the source package get the uncompressed jplayer.playlist.js file. You'll want to look around line 243 for the bit that spits out the HTML of the playlist. You can use the poster parameter to add your thumnails in to the playlist HTML. Something like this (untested code):

// add the image
listItem += "<a href='javascript:;' class='" + this.options.playlistOptions.itemClass + "-thumb' tabindex='1'><img src='" + media.poster + "' /></a>";
// existing code to make the title
listItem += "<a href='javascript:;' class='" + this.options.playlistOptions.itemClass + "' tabindex='1'>" + media.title + (media.artist ? " <span class='jp-artist'>by " + media.artist + "</span>" : "") + "</a>";

Next you'll want to start with one of the theme CSS files as a reference for some of the essentials relating to video and then redo the rest from scratch to build the player to match your design.

Also checkout the setPlaylist demo and all the other cool stuff you can now do with playlists:

http://jplayer.org/latest/demo-02-jPlayerPlaylist/

I've found this method of loading / altering playlists to be extremely awesome.



来源:https://stackoverflow.com/questions/10636933/jplayer-multi-video-demo-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!