Skip to content

Instantly share code, notes, and snippets.

@brettgaylor
Forked from humphd/popcorn-youtube.html
Created June 24, 2011 21:47
Show Gist options
  • Save brettgaylor/1045762 to your computer and use it in GitHub Desktop.
Save brettgaylor/1045762 to your computer and use it in GitHub Desktop.
Popcorn YouTube Example
<!doctype html>
<html>
<head>
<script src="http://popcornjs.org/code/dist/popcorn-complete.min.js"></script>
<script>
// ensure the web page (DOM) has loaded
document.addEventListener("DOMContentLoaded", function () {
// Create a popcorn instance by calling the Youtube player plugin
var example = Popcorn.youtube(
'#video',
'http://www.youtube.com/watch?v=CxvgCLgwdNk' );
// add a footnote at 2 seconds, and remove it at 6 seconds
example.footnote({
start: 2,
end: 6,
text: "Pop!",
target: "footnotediv"
});
// play the video right away
example.play();
}, false);
</script>
</head>
<body>
<div id="video" style="width: 360px; height: 300px;" ></div>
<div id="footnotediv"></div>
</body>
</html>
@watertower
Copy link

This does not work, get Console Warnings:

Deprecated player 'youtube'. Please use Popcorn.HTMLYouTubeVideoElement directly.
failed to retreive duration data, reason: No longer available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment