#346 ✓ checked-in
David Humphrey

Create a Code Plugin

Reported by David Humphrey | February 16th, 2011 @ 10:20 AM | in 0.4

The idea is to create a simple way for people to shoehorn timed events that follow no pattern into popcorn. I myself want it right now in order to write some better tests, without also including any particular plugin, and any bugs it might have.

The way this will work is as follows:

var p = Popcorn('#video')

        /* onStart function only
        .code({
          start: 1,
          end, 4,
          onStart: function( options ) {
            // called on start
          }
        })

        /* onStart + onEnd only
        .code({
          start: 6,
          end, 8,
          onStart: function( options ) {
            // called on start
          },
          onEnd: function ( options ) {
            // called on end
          }
        })

        /* onStart, onEnd, onFrame
        .code({
          start: 10,
          end, 14,
          onStart: function( options ) {
            // called on start
          },
          onFrame: function ( options ) {
            // called on every paint frame between start and end.
            // uses mozRequestAnimationFrame, webkitRequestAnimationFrame,
            // or setTimeout with 16ms window.
          },
          onEnd: function ( options ) {
            // called on end
          }
        });

The reason for this is to allow one-off plugin behaviour without the need to actually write a plugin.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.

Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.

Shared Ticket Bins

Tags

Pages