var p = Popcorn('#video')
.flickr({
start: 5, // seconds
- end: 10, // seconds
- userid: '35034346917@N01',
- numberofimages: '8',
- target: 'flickrdiv'
- } )
- .flickr({
- start: 10, // seconds
end: 15, // seconds
userid: '35034346917@N01',
- tags: 'georgia',
- numberofimages: '8',
- target: 'flickrdiv'
- } )
- .flickr({
- start: 15, // seconds
- end: 20, // seconds
- tags: 'georgia',
- numberofimages: '8',
target: 'flickrdiv'
} )
.flickr({
start: 20, // seconds
- end: 25, // seconds
- tags: 'georgia,fish',
+ end: 30, // seconds
+ tags: 'georgia',
numberofimages: '8',
target: 'flickrdiv'
} )
.flickr({
- start: 30, // seconds
+ start: 35, // seconds
end: 45, // seconds
- userid: '78868639@N00',
+ userid: '35034346917@N01',
+ tags: 'georgia',
+ numberofimages: '8',
target: 'flickrdiv'
} )
.play();
<body>
<h1 id="qunit-header">Popcorn Flickr Plug-in Demo</h1>
<p>This plugin requires jquery</p>
- <p>Flickr images will appear at 5 seconds and disappear at 15 seconds.</p>
- <p>More Flickr images will appear at 20 seconds and disappear at 45 seconds.</p>
+ <p>Flickr images by '35034346917@N01' will appear at 5 seconds and disappear at 15 seconds.
+ <br />Flickr images tagged 'georgia' will appear at 20 seconds and disappear at 30 seconds.
+ <br />Flickr images by '35034346917@N01' and tagged 'georgia' will appear at 35 seconds and disappear at 45 seconds.</p>
<div>
<video id='video'
controls
// PLUGIN: FLICKR
(function (Popcorn) {
-
/**
* Flickr popcorn plug-in
* Appends a users Flickr images to an element on the page.
* Start is the time that you want this plug-in to execute
* End is the time that you want this plug-in to stop executing
* Userid is the id of who's Flickr images you wish to show
+ * Tags is a mutually exclusive list of image descriptor tags
* Target is the id of the document element that the images are
* appended to, this target element must exist on the DOM
* Numberofimages specify the number of images to retreive from flickr, defaults to 8
.footnote({
start: 5, // seconds, mandatory
end: 15, // seconds, mandatory
- userid: '35034346917@N01', // mandatory
+ userid: '35034346917@N01', // optional
+ tags: 'dogs,cats', // optional
numberofimages: '8', // optional
height: '50px', // optional
width: '50px', // optional
manifest: {
about:{
name: "Popcorn Flickr Plugin",
- version: "0.1",
- author: "Scott Downe",
+ version: "0.1.1",
+ author: "Scott Downe, Steven Weerdenburg",
website: "http://scottdowne.wordpress.com/"
},
options:{
if ( tags ) {
uri += "tags="+tags+"&";
}
-
- /*uri += "lang=en-us&format=json&jsoncallback=jsonp";
-
- Popcorn.xhr.getJSONP( uri,
- function( data ) {
- options.container.innerHTML = "<p style='padding:" + padding + ";'>" + data.title + "<p/>";
-
- Popcorn.forEach( data.items, function ( item, i ) {
- if ( i < count ) {
- var link = document.createElement('a');
- link.setAttribute( 'href', item.link );
- link.setAttribute( "target", "_blank" );
- var image = document.createElement( 'img' );
- image.setAttribute( 'src', item.media.m );
- image.setAttribute( 'height', height );
- image.setAttribute( 'width', width );
- image.setAttribute( 'style', 'border:' + border + ';padding:' + padding );
- link.appendChild( image );
-
- options.container.appendChild( link );
- } else {
- return false;
- }
- });
- }
- );*/
uri += "lang=en-us&format=json&jsoncallback=?";
- $.getJSON( uri, function( data ){
+
+ $.getJSON( uri, function( data ) {
options.container.innerHTML = "<p style='padding:" + padding + ";'>" + data.title + "<p/>";
- $.each( data.items, function( i, item ) {
+
+ Popcorn.forEach( data.items, function ( item, i ) {
if ( i < count ) {
var link = document.createElement('a');
link.setAttribute( 'href', item.link );