+++ /dev/null
-<!DOCTYPE html>
-<html>
-<head>
- <title>Popcorn API Draft DEMO</title>
- <script src="../../popcorn.js"></script>
- <script src="popcorn.image.js"></script>
-
- <script>
- document.addEventListener('DOMContentLoaded', function(){
- Popcorn('#video')
- .image({
- start : 1,
- end : 8,
- target : 'image-container',
- src : 'http://nutrihealth.in/wp-content/uploads/2010/04/popcorn-250x300.jpg',
- alt : 'Bucket of Popcorn',
- title : 'Popcorn.js!',
- click : function(){
- alert('Re-directing you to Popcorn.js web site.');
- window.location = 'http://mozilla.github.com/popcorn-js/';
- }
- });
- }, false);
- </script>
-
-</head>
-<body>
- <h1 id="qunit-header">Popcorn Image Demo</h1>
-
- <video id='video'
- style="float:left"
- controls preload='none'
- poster="http://media.w3.org/2010/05/sintel/poster.png">
-
- <source id='mp4'
- src="http://media.w3.org/2010/05/sintel/trailer.mp4"
- type='video/mp4; codecs="avc1, mp4a"'>
-
- <source id='ogv'
- src="http://media.w3.org/2010/05/sintel/trailer.ogv"
- type='video/ogg; codecs="theora, vorbis"'>
-
- <p>Your browser does not support the HTML5 Video element.</p>
-
- </video>
-
- <div id="image-container" style="border:1px solid black"></div>
-
-</body>
-</html>
+++ /dev/null
-// EXAMPLE PLUGIN: IMAGE
-
-(function (Popcorn) {
-
- Popcorn.plugin( "image" , (function(){
-
- var container, img, src, title, alt, clickListener, loadListener
-
- return {
-
- start: function(event, options){
-
- container = document.getElementById(options.target);
- img = new Image();
-
- loadListener = function(){
- this.alt = options.alt;
- this.title = options.title;
-
- clickListener = function(){ options.click.call( img ); };
- this.addEventListener('click', function(){ clickListener(); }, false);
-
- container.appendChild( img );
- };
-
- img.addEventListener('load', function(){ loadListener.call( img ) }, false);
-
- img.src = options.src;
- },
-
- end: function(event, options){
- img.removeEventListener( 'load', loadListener, false );
- img.removeEventListener( 'click', clickListener, false );
- container.removeChild( img );
- }
-
- };
-
- })());
-
-})( Popcorn );