在播放列表中搜索

  抱歉,这篇文章有英文版

You can enable the search in the playlist via settings Plugins / Playlist / Search in playlist

A search bar will appear in the interface if the number of items in the playlist (or open folder) exceeds the specified limit (3 in the example below). The search bar will be displayed only when the playlist is placed vertically, including the drop-down list mode.

You can copy this template from the free library.

Via API

A playlist must contain a unique id for each file so that the player can find the desired one. For example

[
   {"title":"Serie 1","file":"//site.com/s1.mp4","id":"s1"},
   {"title":"Serie 2","file":"//site.com/s2.mp4","id":"s2"},
   {"title":"Serie 3","file":"//site.com/s3.mp4","id":"s3"}
]

Now you can find and open the file with JS API (the player will wait for the start)

player.api("find","s2");

You can immediately autostart playback (on mobile requires user action or mute)

player.api("play","id:s2");

You can run the file from the desired second by adding the seek command in square brackets

player.api("play","id:s2[seek:10]");

The query playlist_id returns the id of the active file

alert(player.api("playlist_id"));

20.0.1
2024 © PlayerJS

登录

登录

免费注册

注册
注册即表示您同意服务条款
登录(如果您有帐户)

恢复密码

恢复
忘记电子邮件?联系我们