#297 ✓ checked-in
Scott Downe

parser plugins need access to JSONP

Reported by Scott Downe | January 26th, 2011 @ 04:21 PM | in 0.4

The parser plugins request some sort of xhr data (XML, JSON or text), but they don't do the required flag to get JSONP.

Comments and changes to this ticket

  • annasob

    annasob February 8th, 2011 @ 05:32 PM

    • Milestone changed from 0.3 release date to 0.4
    • Milestone order changed from “28” to “0”
  • Scott Downe

    Scott Downe February 18th, 2011 @ 12:37 PM

    • State changed from “new” to “assigned”
    • Assigned user set to “Scott Downe”
  • Scott Downe

    Scott Downe February 18th, 2011 @ 01:41 PM

    Working on this, I noticed I get something totally wrong when I made the parser plugin framework.

    When you define a parser, you pass in name, type, and a function. Type should be the data type that is passed into the xhr function, and it should be optional.

    So the signature will now look like:

    name, type, function.
    name, function.

    This way, it is the same as the way the xhr function can be called. If a data type exists, it returns that datatype, if no datatype exists, you get an object called data, which has the json, text and xml data as object members.

    So now if you create a parser like so: Popcorn.parser( "parseJSONP", "jsonp", function( data ){} ) it will pass the datatype "jsonp" into the xhr function, and data will contain your jsonp. If you do it like this: Popcorn.parser( "parseJSONP", function( data ){} ) data will just be a generic object with data.json, data.text and data.xml. This is how our xhr function works, and the parsers should be the same and just use the structure already there.

  • Scott Downe

    Scott Downe February 18th, 2011 @ 02:36 PM

    Alright, another change i am going to try.

    When we load something in from data-timeline-sources, we link up the parser and data based on the data type after the file name split on a ":". if there is no ":", we key on file extension.

    I think the filetype after the ":" should instead be the name of the parser.

    Inside the code, we make an assumption that all parser names are "parser" + filetype.

    parserFn = "parse" + dataType;
    

    If we linked the parser NAME instead of datatype, we don't have to make this assumption.

  • Scott Downe

    Scott Downe February 18th, 2011 @ 02:38 PM

    Third change... :)

    I am going to make calls to parsers accept a callback function, that will be called once the data is parsed and tracks have been created.

    This is more of just an addition instead of a change.

  • Scott Downe

    Scott Downe February 18th, 2011 @ 04:07 PM

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

    Rick February 20th, 2011 @ 07:29 PM

    Great work

    Tested in: Chrome, FF 3.6 & 4.0b12

    Tested with: Popcorn.js Test Suite, All 8 Parser Test Suites

  • Rick

    Rick February 20th, 2011 @ 07:29 PM

    • State changed from “peer-review-requested” to “super-review-requested”
    • Assigned user changed from “Scott Downe” to “annasob”
  • annasob

    annasob February 24th, 2011 @ 03:57 PM

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

    This stuff looks good.
    Ran lint no errors
    Ran all of the parser demos/tests on FF 3.6 and Chrome
    Ran the main unit tests on both browsers as well

    SR+

  • annasob

    annasob February 24th, 2011 @ 04:05 PM

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

    Staged in annasob/popcorn-js commit

  • Rick

    Rick March 4th, 2011 @ 12:39 PM

    (from [8026a9f12811e8fad56fed2f673df3d5d026db2a]) [#297] parser plugin datatype playing nice with xhr and data-timeline-sources, plus parser callback for testing https://github.com/rwldrn/popcorn-js/commit/8026a9f12811e8fad56fed2...

  • annasob

    annasob March 21st, 2011 @ 02:47 PM

    • State changed from “staged” to “checked-in”
    • Milestone order changed from “12” to “0”
  • annasob

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