Outside playlist

The playlist from the player can be moved to the outer container. Firstly you need to catch init event when the player is ready to work with the API. Then create a player with a playlist and move it.

<div id="player1"></div>
<div id="playlist_container"></div>
   var player = new Playerjs({
   function PlayerInit(){

Important points

  • If you want to catch init event with a listener, you need to enable the option Plugins / API / Events tracking / Use listeners
  • Navigation arrows do not move with the playlist. They can disabled it in the settings Plugins / Playlist / Scroll arrows and make your own if you need.
  • The playlist button must also be turned off (in the Elements section).
  • The player continues to interact with the playlist after moving.
  • Read more about playlist


How to make buttons for navigation

The playlist is available in the DOM by the playerid_playlist id, where playerid is the id of the player. If the player has id = player, then the playlist object can be accessed at player_playlist.

An example with buttons for a horizontal playlist (using jquery):

var playlist = $("#player_playlist");
$(".right_scroll_button").click(function() {
      scrollLeft: playlist.scrollLeft()+100
   }, 500);
$(".left_scroll_button").click(function() {
      scrollLeft: playlist.scrollLeft()-100
   }, 500);

You can adjust the speed if you change the numbers in the code (100 is the number of pixels to scroll, and 500 is the time of the animation).

An example with buttons for a vertical playlist (using jquery):

var playlist = $("#player_playlist");
$(".up_scroll_button").click(function() {
      scrollTop: playlist.scrollTop()-100
   }, 500);
$(".down_scroll_button").click(function() {
      scrollTop: playlist.scrollTop()+100
   }, 500);

2024 © PlayerJS

Sign up free

Sign up
By signing up, you agree to Terms of Service
Login if you have an account

Restore password

Forgot email? Contact us