Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container">
  <div>
    <ul id="menu">
      <li>
        <input id="tab0" type="button" class="button" onclick="processTab(0);" value="Short Videos"></input>
      </li>
      <li>
        <input id="tab1" type="button" class="button" onclick="processTab(1);" value="Assorted Bugs and Birds">
      </li>
      <li>
        <input id="tab2" type="button" class="button" onclick="processTab(2);" value="Sea and Water">
      </li>
      <li><input id="tab3" type="button" class="button" onclick="processTab(3);" value="Sea Life"></li>
    </ul>
  </div>

  <div class="myplayer">

    <video-js id="myPlayerID"
              data-account="1752604059001"
              data-player="SJly4aArKZ"
              data-embed="default"
              data-application-id
              controls
              width="450"
              height="253.13"></video-js>
            <script src="https://players.brightcove.net/1752604059001/SJly4aArKZ_default/index.min.js"></script>
            <ol class="vjs-playlist"></ol>
  </div>
</div>
              
            
!

CSS

              
                /* * The body style is just for the
 * background color of the codepen.
 * Do not include in your code.
 */
body {
  background-color: #111;
  color: #fff;
}
/*
 * Styles essential to the sample
 * are below
 */

/* Set the size of the container for the video player and tabbed playlist */
.container {
  width: 1100px;
  height: 400px;
}

/* Style the tabbed menu */
#menu {
  float: right;
  padding: 0;
  padding-right: 85px;
  margin: 0;
  color: #fff;
  font-family: arial, helvetica, sans-serif;
  white-space: nowrap;
  list-style-type: none;
}

#menu li {
  display: inline;
}

#menu li input {
  min-width: 50px;
  height: 30px;
  padding: 0.2em 1em;
  background: #0000cc;
  color: #fff;
  text-decoration: none;
  float: left;
  border: 1px solid #fff;
  border-top-left-radius: 1em;
  border-top-right-radius: 1em;
}

.button {
  background: #0000cc;
}

#menu li input:hover {
  background: #08c;
  color: #fff;
}

/* Set the size and location of the player */
.video-js {
  width: 650px !important;
  height: 360px !important;
  float: left;
}
.myplayer {
  clear: both;
  width: 100%;
  height: 100%;
  position: relative;
}

/* Set the size of the tabbed playlist */
.vjs-playlist {
  width: 365px;
  height: 360px;
}
              
            
!

JS

              
                var myPlayer,
  // Define an array of playlist Ids
  playlistIds = ["4450721964001", "2805100167001", "2764931905001","1754200320001"],
  // Get the playlist array length
  playlistIdsLength = playlistIds.length,
  // Get a reference to the playlist tabs
  tabs = document.getElementsByClassName("button"),
  currentTab,
  currentTabName,
  playlistNames = [];

videojs.getPlayer('myPlayerID').ready(function() {
  // Get a reference to the player when it is ready
  myPlayer = this;
  // Load the first playlist tab into the player
  processTab(0);
});

// +++ Set selected tab and load video +++
function processTab(index) {
  // Reset the tabs so that none of them are selected/highlighted
  resetTabs();
  // Highlight the selected tab in the navigation
  document.getElementById("tab" + index).setAttribute("style", "background:#08c;color: #00FFFF; border-bottom: 1px solid #00FFFF;");
  // Load the selected tab's playlist into the player
  loadPlaylist(playlistIds[index]);
};

// +++ Load selected playlist and first video +++
function loadPlaylist(currentId) {
  // Get the playlist object for the currently selected tab
  myPlayer.catalog.getPlaylist(currentId, function(error, playlist) {
    // Load the playlist into the player
    myPlayer.catalog.load(playlist);
    // Load the first video in the playlist into the player
    myPlayer.playlist.currentItem(0);
  });
};

// +++ reset all tabs +++
function resetTabs() {
  // Turn highlighting off for all of the tabs
  var i,
    iMax = tabs.length;
  for (i = 0; i < iMax; i++) {
    tabs[i].setAttribute("style", "background: #0000cc;color: #fff;")
  }
}
              
            
!
999px

Console