<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type="text/css" />
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<title>JS Bin</title>
</head>
<body>
<div class="row is-flex" id="hg-container">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 mt-4">
<div class="card hangout">
<div class="box ">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item player" src="https://www.youtube.com/embed/hreqPj9geeI?enablejsapi=1&origin=http://localhost:3000"
id="hreqPj9geeI" style='background-image:url("https://img.youtube.com/vi/hreqPj9geeI/sddefault.jpg")'>
</iframe>
</div>
<div class="card-block">
<div class="meta">
<h4 class="card-title"><a href="/events/osra-pp-on-orphan-model">OSRA - PP on Orphan model</a></h4>
<div class='row' data-event-instance-id=199>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 mt-4">
<div class="card hangout">
<div class="box ">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item player" src="https://www.youtube.com/embed/i4eWMOKHpZM?enablejsapi=1&origin=http://localhost:3000"
id="i4eWMOKHpZM" style='background-image:url("https://img.youtube.com/vi/i4eWMOKHpZM/sddefault.jpg")'>
</iframe>
</div>
<div class="card-block">
<div class="meta">
<h4 class="card-title"><a href="/events/atlantic-scrum">Atlantic Scrum</a></h4>
<div class='row' data-event-instance-id=198>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 mt-4">
<div class="card hangout">
<div class="box ">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item player" src="https://www.youtube.com/embed/sXDHIHmOLKg?enablejsapi=1&origin=http://localhost:3000"
id="sXDHIHmOLKg" style='background-image:url("https://img.youtube.com/vi/sXDHIHmOLKg/sddefault.jpg")'>
</iframe>
</div>
<div class="card-block">
<div class="meta">
<h4 class="card-title"><a href="/events/atlantic-scrum">Atlantic Scrum</a></h4>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var players = {}
var player
var currentPlayerId = null
var currentPlayer = null
$(document).ready(function(){
$('#hg-container').on("mouseenter", ".card", function(){
currentPlayerId = $(this).find('iframe').attr('id');
player = $(this).find('iframe')[0];
if (!players[currentPlayerId]){
players[currentPlayerId] = new YT.Player(player, {
playerVars: { 'autoplay': 1 },
events: {'onReady': onPlayerReady }
});
}
else{
currentPlayer = players[currentPlayerId]
currentPlayer.playVideo();
}
});
$('#hg-container').on("mouseleave", ".card", function(){
currentPlayer.pauseVideo();
currentPlayer = null;
});
});
function onPlayerReady(event) {
currentPlayer = players[currentPlayerId]
currentPlayer.seekTo(10);
currentPlayer.playVideo();
}
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. |