#470 ✓ staged
Scott Downe

not getting expected options object via inheritence

Reported by Scott Downe | April 12th, 2011 @ 11:55 AM | in 0.5

Given an example like this:

    Popcorn.plugin("c", {
        _setup: function( options ) { 
          options._container = "item";
          console.log( options._container );
        },
        start: function( event, options ) {
          console.log( options._container );
        },
        end: function( event, options ) {
          console.log( options._container );
        }
    });
    Popcorn.inherit("d", "c", {
        _setup: function( options ) {
          console.log( options._container );
        },
        start: function( event, options ) {
          console.log( options._container );
        },
        end: function( event, options ) {
          console.log( options._container );
        }
    });

Am I correct to expect the options object to be the same in all 6 function calls?

cc'ing db48x

Comments and changes to this ticket

  • Scott Downe

    Scott Downe April 12th, 2011 @ 12:02 PM

    A full example:

    <!DOCTYPE html>
    <html>
    <head>
      
      <script src="https://github.com/annasob/popcorn-js/raw/0.5/popcorn.js"></script>
      <script>
        document.addEventListener('DOMContentLoaded', function () {
    
        Popcorn.plugin("c", {
            _setup: function( options ) { 
              options._container = "item";
              console.log( options._container );
            },
            start: function( event, options ) {
              console.log( options._container );
            },
            end: function( event, options ) {
              console.log( options._container );
            }
        });
        Popcorn.inherit("d", "c", {
            _setup: function( options ) {
              console.log( options._container );
            },
            start: function( event, options ) {
              console.log( options._container );
            },
            end: function( event, options ) {
              console.log( options._container );
            }
        });
    
          var p = Popcorn('#video')
          .play()
          .c({
            start: 0, // seconds
            end: 10 // seconds
          })
          .d({
            start: 5, // seconds
            end: 15 // seconds
          })
    
        }, false);
          
      </script>
    </head>
    <body>
      <div>
        <video id='video' 
          controls src="http://videos.mozilla.org/serv/webmademovies/wtfpopcorn.ogv"
          width= '250px'>
        </video> 
      </div>
      </div>
    </body>
    </html>
    
  • Scott Downe

    Scott Downe April 12th, 2011 @ 12:52 PM

    • State changed from “new” to “assigned”
    • Milestone changed from 0.6 to 0.5
    • Assigned user set to “Scott Downe”
    • Milestone order changed from “33” to “0”

    I think I figured it out.

    Patch+tests in the works.

  • Scott Downe

    Scott Downe April 12th, 2011 @ 02:09 PM

    • State changed from “assigned” to “peer-review-requested”
  • db48x

    db48x April 12th, 2011 @ 05:55 PM

    • State changed from “peer-review-requested” to “review-looks-good”

    Oops :)

  • db48x

    db48x April 12th, 2011 @ 05:57 PM

    One thing though, update the comment next to the expects value so that it adds up correctly

  • Scott Downe

    Scott Downe April 12th, 2011 @ 08:39 PM

    • State changed from “review-looks-good” to “review-needs-work”

    Oh yeah, I forgot about that. I will update that tomorrow ;)

  • Scott Downe

    Scott Downe April 13th, 2011 @ 09:28 AM

    • State changed from “review-needs-work” to “super-review-requested”
  • Scott Downe

    Scott Downe April 13th, 2011 @ 11:00 AM

    • Assigned user cleared.
  • annasob

    annasob April 13th, 2011 @ 12:45 PM

    • State changed from “super-review-requested” to “review-looks-good”

    This looks good! Nice catch.

    Unit tests pass on Chrome, FF 3.6 and 4.0
    no lint

  • annasob

    annasob April 13th, 2011 @ 12:46 PM

    • State changed from “review-looks-good” to “staged”

    Staged in annasob/popcorn-js commit

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

Pages