No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Latest commit ccf4316 May 17, 2012 @cadecairos cadecairos Merge pull request #41 from cadecairos/issue-35-36
Issue 35 36
Permalink
Failed to load latest commit information.
build
test style fixes for play() update and tests, detabbed the files. [#36 and #… May 17, 2012
.gitignore
Makefile Migrate from JSLint to JSHint Apr 22, 2011
popcorn.sequence.js
readme.markdown

readme.markdown

Popcorn.sequence.js

Create video clip sequences that playback seamlessly


Contributions should follow these guidelines: http://github.com/rwldrn/idiomatic.js


Usage:

var sequence = Popcorn.sequence(
				"container-id",
				[
					{
						src: "assets/snowdriving.ogv",
						in: 0,
						out: 5
					},
					{
						src: "assets/snowdriving.ogv",
						in: 7,
						out: 10
					},
					{
						src: "assets/snowdriving.ogv",
						in: 3,
						out: 6
					}
				]);

Sequences implement the following methods:

// Return a Popcorn object for "assets/snowdriving.ogv"

sequence.eq( 0 );



// Play the sequence

sequence.play();



// Execute a callback at the 4th second in the sequence

sequence.exec( 4, function() {

});



// Listen for an event in the sequence

sequence.listen( eventName, function() {

	// canplaythrough, loadedmetadata, loadeddata events will fire only when all clips have fired
	// timeupdate, play, pause will fire on the currently active clip

});



// TODO: Add sequence.listen() example

For seamless playback, be sure to wrap playback in a "canplaythrough" event callback

Todo:

Somehow need to get back to previous videos?