Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


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

  <div class="myplayer">

    <video-js id="myPlayerID"
            <script src=""></script>
            <ol class="vjs-playlist"></ol>


                /* * 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;


                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"),
  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

// +++ Set selected tab and load video +++
function processTab(index) {
  // Reset the tabs so that none of them are selected/highlighted
  // 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

// +++ 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
    // Load the first video in the playlist into the player

// +++ 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;")