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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


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.


                <video id="video" controls="" preload="none" poster="">
      <source id="mp4" src="" type="video/mp4">
       <p>Your user agent does not support the HTML5 Video element.</p>
<div id="buttons">
      <button class="large awesome" onclick="document._video.load()">load()</button>
      <button class="large awesome" onclick="">play()</button>
      <button class="large awesome" onclick="document._video.pause()">pause()</button>
      <button class="large awesome" onclick="document._video.currentTime+=10">currentTime+=10</button>
      <button class="large awesome" onclick="document._video.currentTime-=10">currentTime-=10</button>
      <button class="large awesome" onclick="document._video.currentTime=50">currentTime=50</button><br>
      <button class="large awesome" onclick="document._video.playbackRate++">playbackRate++</button>
      <button class="large awesome" onclick="document._video.playbackRate--">playbackRate--</button>
      <button class="large awesome" onclick="document._video.playbackRate+=0.1">playbackRate+=0.1</button>
      <button class="large awesome" onclick="document._video.playbackRate-=0.1">playbackRate-=0.1</button><br>
      <button class="large awesome" onclick="document._video.volume+=0.1">volume+=0.1</button>
      <button class="large awesome" onclick="document._video.volume-=0.1">volume-=0.1</button>
      <button class="large red awesome" onclick="document._video.muted=true">muted=true</button>
      <button class="large red awesome" onclick="document._video.muted=false">muted=false</button><br>
      <button class="large blue awesome" onclick="switchVideo(0);">Sintel teaser</button>
      <button class="large blue awesome" onclick="switchVideo(1);">Bunny trailer</button>
      <button class="large blue awesome" onclick="switchVideo(2);">Bunny movie</button>
      <button class="large blue awesome" onclick="switchVideo(3);">Test movie</button>


                video {
border: 1px solid black;
padding: 0;
margin: 0;
width: 427px;
height: 240px;
background-color: black;
margin: auto;
display: block;
#buttons {
text-align: center;
font-family: Helvetica Neue, "Arial", Helvetica, Verdana, sans-serif;
background: #222;/* url(/images/alert-overlay.png) repeat-x;*/
display: inline-block;
padding: 5px 10px 6px;
color: #fff;
text-decoration: none;
font-weight: bold;
line-height: 1;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
border-bottom: 1px solid rgba(0,0,0,0.25);
position: relative;
cursor: pointer;
.awesome:hover {
background-color: #111;
color: #fff;
.large.awesome {
font-size: 14px;
padding: 8px 14px 9px;
.red.awesome {
background-color: #e33100;
.blue.awesome {
background-color: #2daebf;
.blue.awesome:hover {
background-color: #007d9a;
.red.awesome:hover {
background-color: #872300;


                function init() {
    document._video = document.getElementById("video");
document.addEventListener("DOMContentLoaded", init, false);

//switching videos (playlist)
var videos = 
function switchVideo(n) {
	if (n >= videos.length) n = 0;

	var mp4 = document.getElementById("mp4");
	var parent = mp4.parentNode;

	document._video.setAttribute("poster", videos[n][0]);
	mp4.setAttribute("src", videos[n][1]);
/*An example of all the options of the media API in HTML5
More info here:

Buttons styled with RGBA, more info here: