<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
header, nav, footer, article {display:block; border: 1px solid #000;}
header { background: red; }
nav {float:left; width: 20%; background: blue; }
article {float:right; width: 79%; background: green; }
footer {clear:both; background: red; }
.videochrome {
position: relative;
overflow: hidden;
}
.videochrome .controls {
position: absolute;
/* top: 0;*/
height: 20px;
bottom: 0;
left: 0;
right: 0;
opacity: 0;
transition: opacity ease-out 200ms;
transition: opacity ease-out 200ms;
transition: opacity ease-out 200ms;
transition: opacity ease-out 200ms;
}
.videochrome .play {
color: #fff;
border: 0;
cursor: pointer;
width: 30px;
font-size: 17px;
line-height: 30px;
height: 30px;
display: block;
float: left;
font-family: arial;
background: transparent;
}
.videochrome .duration {
margin-left: 10px;
margin-right: 10px;
font-family: "helvetica neue", arial, helvetica;
float: right;
display: block;
font-size: 10px;
line-height: 30px;
height: 30px;
}
.videochrome .play[paused] {
font-size: 12px;
}
.videochrome .play[disabled] {
display: none;
}
.videochrome .scrub {
position: absolute;
height: 30px;
bottom: -30px;
color: #fff;
width: 100%;
background: rgba(0,0,0,.5);
transition: bottom ease-out 200ms;
transition: bottom ease-out 200ms;
transition: bottom ease-out 200ms;
transition: bottom ease-out 200ms;
}
.videochrome .scrub .loaded {
background: rgba(229,229,229,0.3);
margin: 10px 0;
height: 10px;
overflow: hidden;
cursor: pointer;
border-radius: 10px;
border-radius: 10px;
border-radius: 10px;
}
.videochrome:hover .controls,
.videochrome.paused .controls {
opacity: 1;
}
.videochrome.paused .controls .scrub,
.videochrome:hover .scrub {
bottom: 0;
}
.videochrome .controls .loaded .buffer {
border-radius: 10px;
border-radius: 10px;
border-radius: 10px;
background: rgba(255,255,255,0.7);
width: 0%;
height: 10px;
cursor: pointer;
}
.videochrome .controls .loaded .playhead {
border-radius: 10px;
border-radius: 10px;
border-radius: 10px;
color: #393939;
line-height: 10px;
font-family: "helvetica neue", arial, helvetica;
text-align: right;
font-size: 10px;
background: #fff;
width: 0%;
height: 10px;
}
.videochrome .controls .playhead span {
padding: 0 5px;
}
.videochrome .controls .scrub div {
transition: width linear 100ms;
transition: width linear 100ms;
transition: width linear 100ms;
transition: width linear 100ms;
}
.videochrome .controls .scrub div.scrubbing {
transition: none ;
transition: none;
transition: width none;
transition: none;
}
</style>
</head>
<body>
<header>
HTML5 Video
</header>
<nav>
<h1>Navigation</h1>
<ul>
<li><a href="#video1">Video 1</a></li>
<li><a href="">Link</a></li>
<li><a href="">Link</a></li>
<li><a href="">Link</a></li>
</ul>
</nav>
<article id="video2">
<h1>Video - Custom Controls</h1>
<!-- <button class="play" title="play" id="playButton">►</button> -->
<div class="videochrome paused">
<video controls preload="meta">
<source src="http://www.tools4movies.com/dvd_catalyst_profile_samples/The%20Amazing%20Spiderman%20tablet.mp4" />
This is video fallback
</video>
<div class="controls">
<div class="scrub">
<button class="play" title="play" id="playButton">►</button>
<div class="duration">0:00</div>
<div class="loaded"><div class="buffer"><div class="playhead"><span>0:00</span></div></div></div>
</div>
</div>
</div>
</article>
<footer>
Footer
</footer>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |