#863 ✓ staged
Scott Downe

youtube error event test is inherently broken

Reported by Scott Downe | December 16th, 2011 @ 03:20 PM | in 1.2 (closed)

The youtube tests can timeout on this final test.

  var pop = Popcorn.youtube( "#video4", "http://www.youtube.com/watch?v=abcdefghijk" );

  pop.listen( "error", function() {
    ok( true, "error trigger by invalid URL" );
    start();
  });

What is happening is the error happens too fast for the listener to be created.

My proposed solution to this is to consider allowing an instance of Popcorn to exist without a video. (Popcorn();)

Then later, at any time, dynamically, you can do this:

var p = Popcorn();
p.subtitle({...});
p.set( "#id" ); // not married to the function name set

p.set( "#id2" ); // you can also at any time change the media

This way, we can add listeners before we give the instance a media.

The old way will still work. So nothing in the API is breaking.

Comments and changes to this ticket

  • Scott Downe

    Scott Downe December 16th, 2011 @ 03:25 PM

    • Title changed from “youtube error event is inherently broken” to “youtube error event test is inherently broken”
  • cadecairos

    cadecairos January 20th, 2012 @ 12:50 PM

    • State changed from “new” to “duplicate”

    gonna mark this a duplicate of #882

  • Scott Downe

    Scott Downe January 23rd, 2012 @ 09:30 AM

    • State changed from “duplicate” to “new”

    Actually, I would argue that #882 is to simply put a timeout on the tests so we can continue making tests, and testing Youtube for other issues. I had problems landing an unrelated ticket because of this nonsense, so by creating a timeout, the test can be a known failure. I say this because #882 has a patch to do just that in review.

    This ticket is to fix that known failure. This ticket also doesn't yet know how to solve this problem, other than my proposed ideas. Still needs some discussion.

    I am going to re open this, but feel free to close it again with a counter to my reasoning and we'll work it out from there.

  • cadecairos

    cadecairos January 23rd, 2012 @ 10:36 AM

    That makes sense to me :D

  • Scott Downe

    Scott Downe February 23rd, 2012 @ 05:41 PM

    • Milestone changed from 1.2 to 1.3
    • Milestone order changed from “31” to “0”
  • Scott Downe

    Scott Downe February 29th, 2012 @ 11:49 PM

    • State changed from “new” to “assigned”
    • Assigned user set to “Scott Downe”
    • Milestone changed from 1.3 to 1.2
    • Milestone order changed from “8” to “0”
  • Scott Downe

    Scott Downe February 29th, 2012 @ 11:58 PM

    To solve the listeners problem, might be able to do something similar to what I did in #916.

    The idea is you pass in any events in the options object, example:

      var pop = Popcorn.youtube( "#video4", "http://www.youtube.com/watch?v=abcdefghijk", {
        onerror: function( e ) {
    
          // loading error caught
        },
        onloadedmetadata: function( e ) {
    
          // ready to go
        }
      });
    

    This way, if the callbacks are supplied, youtube or the player can set them up at the key time, so they can be caught, and not lost.

    I am not against the set function, this is just another idea. Might also only be applicable to players, as I don't think HTML5 has these problems what with it being awesome.

  • Scott Downe

    Scott Downe March 1st, 2012 @ 11:57 AM

    • Milestone order changed from “1” to “0”

    Quick change, all events should be in an event hash, but other than that, same deal.

  • Scott Downe

    Scott Downe March 1st, 2012 @ 01:43 PM

    • State changed from “assigned” to “peer-review-requested”
    • Assigned user changed from “Scott Downe” to “cadecairos”

    https://github.com/ScottDowne/popcorn-js/commits/t863

    I was able to keep this in players.

  • cadecairos

    cadecairos March 1st, 2012 @ 03:08 PM

    • State changed from “peer-review-requested” to “super-review-requested”
    • Assigned user changed from “cadecairos” to “David Seifried”

    PR+

    Awesomeeeee

  • David Seifried

    David Seifried March 2nd, 2012 @ 12:13 PM

    • State changed from “super-review-requested” to “review-looks-good”
    • Assigned user changed from “David Seifried” to “cadecairos”

    Yea this ticket made youtube that much better again.

    Tested on FF, Chrome, Opera, and Safari and getting full passes again. Passes lint. SR+

  • cadecairos

    cadecairos March 2nd, 2012 @ 12:59 PM

    • State changed from “review-looks-good” to “staged”
    • Assigned user changed from “cadecairos” to “Scott Downe”

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

Referenced by

Pages