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="outer">
        <div>
            <ul id="menu">
                <li><input id="tab0" type="button" class="button" onclick="processTab(0);" value="Short Videos"></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 id="myPlayerID"
                data-account="1752604059001"
                data-player="b547079e-00cc-4585-b354-04020a7ed70a"
                data-embed="default"
                class="video-js" controls></video> -->
             <video-js id="myPlayerID"
                 data-account="1752604059001"
                 data-player="SJly4aArKZ"
                 data-embed="default"
                 data-application-id
                 class="video-js"
                 controls
                 width="450"
                 height="253"></video-js>
               <script src="https://players.brightcove.net/1752604059001/SJly4aArKZ_default/index.min.js"></script>
        </div><!-- end myplayer-->


        <div class="playlist-wrapper">
            <ol class="vjs-playlist"></ol>
        </div><!-- end playlist-weapper -->

    </div><!-- end outer -->
              
            
!

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
 */
body, html {
      height: 100%;
      width: 100%;
      margin:0;
      padding:0;
    }

    /* container for the tabbed menu, player and playlist */
    .outer {
      width: 100%;
      height: 100%;
      display: block;
      position: relative;
      margin:0;
      background-color: #1a1a1a;
    }

    /* tabbed menu */
    #menu {
        float: right;
        padding:0;
        padding-right: 15px;
        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 player to be responsive */
    .myplayer {
      width: 100%;
      display: block;
      position: absolute;
      margin:0;
      float:left;
      background-color: #1a1a1a;
    }

    .myplayer:after {
      padding-bottom: 56.25%;
      display: block;
      content: '';
    }

    .video-js {
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      left: 0;
      width: 100%;
      height: 100%;
      float:left;
    }

/* playlist stacked below the player */
@media only screen and (max-width:49.999em) and (min-width:20em) {

    .outer  {
      background-color: #1a1a1a;
      overflow-y: hidden;
    }

    .vidWrapper {
      height:100%;
    }

    .myplayer {
      position: relative;
    }

    .playlist-wrapper{
      width: 100%;
      overflow-y: scroll;
      clear:left;
      height:100%;
      overflow-y: hidden;
    }

    .vjs-playlist {
      max-height: 433px;
      position: relative;
      top: 15px;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
    }

    .vjs-playlist .vjs-playlist-item  {
      min-height: 100px;

    }
    .vjs-playlist-item.vjs-selected {
      background: rgb(89, 44,54);
    }

    .vjs-mouse.vjs-playlist .vjs-playlist-description {
      white-space: normal;
      min-height: 99px;
    }
  }

/* horizontal playlist below the player */
@media only screen and (max-width:74.999em) and (min-width:50em) {

    .outer {
      height: 0;
    }
    .myplayer {
      width: 100%;
      position: relative;
    }

    .playlist-wrapper{
      width:100%;
      overflow-x: scroll;
      overflow-y: hidden;
      float:left;
    }

    .vjs-playlist.vjs-playlist {
      width: 100%;
      display: block;
      white-space: nowrap;
      position: relative;
    }

    .vjs-playlist-item {
      display: inline-block;
      height: 75px;
    }
    cite.vjs-playlist-name {
      display:none;
    }
    .vjs-playlist-description {
      display: none;
    }

}

/* vertical playlist to the right of the player */
@media only screen and (max-width: 2500px) and (min-width:75em) {

    .outer  {
      overflow-y: hidden;
    }

    /* the player */
    .myplayer {
      width: 70%;
      position: relative;
    }

    /* the player */
    .video-js {
      float: left;
    }

    /* the playlist */
    .playlist-wrapper{
      width: 30%;
      height: 100%;
      max-height: 653px;
      overflow-x: scroll;
    }
    .vjs-playlist .vjs-playlist-item  {
      min-height: 200px;
      margin: 0;
    }

}
              
            
!

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