<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="Untitled-2.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="parent">
<div class="overlay">
<iframe src="https://player.vimeo.com/video/134945180?api=1&player_id=video" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen id="video"></iframe>
<div class="playpause start"></div>
</div>
</div>
</body>
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="https://f.vimeocdn.com/js/froogaloop2.min.js"></script>
<script>
$(function () {
var iframe = document.getElementById('video');
var player = $f(iframe);
player.addEvent('ready', function () {
player.addEvent('finish', onFinish);
});
$('.playpause').click(function () {
player.api('paused', function (paused) {
if (!paused) {
player.api('pause');
$(".playpause").removeClass('pause');
} else {
player.api('play');
$(".playpause").addClass('pause');
}
});
});
function onFinish(id) {
$(".playpause").removeClass('pause');
}
});
</script>
</html>
@charset "utf-8";
/* CSS Document */
.parent {
width:90%;
margin:50px auto;
position:relative;
z-index:10;
}
/* set up the aspect ratio of the video */
.overlay {
width:100%;
height:0;
padding-bottom:56.25%;
overflow:hidden;
position:relative;
margin:0 auto;
}
/* hide the default video controls */
.overlay iframe {
width:100%;
height:180%;
position:absolute;
left:0;
top:-40%;
z-index:-1;
}
/* Use CSS art to draw the 'Play / Pause' button */
.playpause {
width:68px;
height:40px;
background: transparent;
border: solid #fff 2px;
position:absolute;
left:0;
top:0;
right:0;
bottom:0;
margin:auto;
z-index:100;
opacity:1;
cursor:pointer;
transition: 0.5s;
transition: 0.5s;
}
.playpause:before {
display:block;
content:"";
width:0;
height:0;
border-top:10px solid transparent;
border-bottom:10px solid transparent;
border-left:20px solid #fff;
position:absolute;
left:26px;
top:10px;
}
.playpause.pause {
opacity:0;
transition: 0.5s;
transition: 0.5s;
}
.playpause.pause:before {
display:block;
content:"";
width:6px;
height:20px;
border-left:6px solid #fff;
border-right:6px solid #fff;
border-width:0 6px;
}
.playpause:hover {
border: solid transparent 2px;
}
.overlay:hover .playpause {
opacity:1;
}
@media only screen and (max-width:768px) {
.parent {
width:90%;
margin:50px auto;
}
}
/* fixes for the iPhone and iPad to show default controls */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
.overlay iframe {
height:100%;
top:0;
z-index:200;
}
}
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
.overlay iframe {
height:100%;
top:0;
z-index:200;
}
}
@media only screen and (min-device-width : 375px) and (max-device-width : 667px) {
.overlay iframe {
height:100%;
top:0;
z-index:200;
}
}
@media only screen and (min-device-width : 320px) and (max-device-width : 568px) {
.overlay iframe {
height:100%;
top:0;
z-index:200;
}
}
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
.overlay iframe {
height:100%;
top:0;
z-index:200;
}
}
Output
This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account
Dismiss xKeyboard 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. |