Pen Settings

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <!-- divs around the video element are for responsive sizing -->
		<div style="position: relative; display: block; max-width: 100%;">
			<div style="padding-top: 56.25%;">
        <!-- The autoplay and muted attributes have been added to the video element. Also, the controls attribute has been removed. If you want the video to loop continually, you can add the loop attribute.-->
				<video-js id="myPlayerID"
					autoplay muted
					style="position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; width: 100%; height: 100%;">
	      <script src=""></script>

<!-- This article text block will be displayed over the video background -->
		<div id="article">
				<p>filmed in 2011</p>
				<p><a href="//">original article</a>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur porta dictum turpis, eu mollis justo gravida ac.</p>
              /* * The body style is just for the
 * background color of the codepen.
 * Do not include in your code.
body {
  background-color: #111;
  color: #fff;
  padding-top: 50px;
 * Styles essential to the sample
 * are below
/* Style the player */
body {
  margin: 0;
  background-color: black;
/* Hide the player control bar */
.video-js .vjs-control-bar {
  display: none;
/* Remove click events on the player */
.video-js {
  pointer-events: none;
/* Style the article container and text */
#article {
  font-family: Agenda-Light, Agenda Light, Agenda, Arial Narrow, sans-serif;
  background: rgba(0,0,0,0.3);
  color: white;
  padding: 2rem;
  width: 33%;
  float: right;
  font-size: 1.2rem;
  position: absolute;
  top: .25em;
  right: .25em;
h1 {
  font-size: 2rem;
  text-transform: uppercase;
  margin-top: 0;
  letter-spacing: .3rem;
/* Style the article's Play/Pause button */
a {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  padding: .5rem;
  transition: .6s background;
#article button {
  display: block;
  width: 80%;
  padding: .4rem;
  border: none;
  margin: 1rem auto;
  font-size: 1.3rem;
  background: rgba(255,255,255,0.23);
  color: #fff;
  border-radius: 3px;
  cursor: pointer;
  transition: .3s background;
#article button:hover {
  background: rgba(0,0,0,0.5);
              videojs.getPlayer('myPlayerID').ready(function() {
  // Get a reference to the player and the Play/Pause button in the article block
  var myPlayer = this,
      pauseButton = document.querySelector("#article button");
  // Uncomment the following code to mute the video in JS instead of in the video element
  // myPlayer.muted(true);

  // +++ Configure video end +++
  // Listen for the ended event and display Play button
  myPlayer.on("ended", function() {
    pauseButton.innerHTML = "Play";

  // +++ Configure the Play/Pause button +++
  // Listen for a click event on the Play/Pause button
  // Alternate between play and pause states
  pauseButton.addEventListener("click", function() {
    if (myPlayer.paused()) {;
      pauseButton.innerHTML = "Pause";
    } else {
      pauseButton.innerHTML = "Play";
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.