├── .gitattributes
├── .gitignore
├── AUTHORS
├── CHANGELOG.md
├── ISSUE_TEMPLATE.md
├── LICENSE
├── LICENSE_HEADER
├── Makefile
├── bower.json
├── build
├── google-compiler-20100917.jar
├── js.jar
├── jslint-check.js
└── jslint.js
├── demos
└── semantic_video
│ ├── images
│ ├── arro.png
│ ├── body_bg.jpg
│ ├── bubble_pointer.png
│ ├── drumbeat_logo.png
│ ├── expand_collapse.png
│ ├── footer.jpg
│ ├── footer_bg.jpg
│ ├── footer_border.jpg
│ ├── footer_drumbeat.png
│ ├── footer_webmade.png
│ ├── footnote.png
│ ├── header.jpg
│ ├── logo_flickr.png
│ ├── logo_google_news.png
│ ├── logo_lastfm.png
│ ├── logo_tumblr.png
│ ├── logo_twitter.png
│ ├── logo_wiki.png
│ ├── overlay
│ │ ├── flickr.png
│ │ ├── footnote.png
│ │ ├── lastfm.png
│ │ ├── location.png
│ │ ├── twitter.png
│ │ └── wiki.png
│ └── video_icon.png
│ ├── index.html
│ ├── popcorn.applyclass.js
│ ├── style.css
│ └── xml
│ └── webMadeMovies.xml
├── effects
└── applyclass
│ ├── popcorn.applyclass.html
│ ├── popcorn.applyclass.js
│ └── style.css
├── example.html
├── ie8
├── popcorn.ie8.html
├── popcorn.ie8.js
└── popcorn.ie8.unit.html
├── modules
├── locale
│ ├── popcorn.locale.js
│ ├── popcorn.locale.unit.html
│ └── popcorn.locale.unit.js
├── parser
│ ├── data
│ │ ├── parseMissing.json
│ │ ├── parserAudio.json
│ │ └── parserData.json
│ ├── popcorn.parser.js
│ ├── popcorn.parser.unit.html
│ └── popcorn.parser.unit.js
├── player
│ ├── popcorn.player.js
│ ├── popcorn.player.unit.html
│ └── popcorn.player.unit.js
└── timeline-sources
│ ├── popcorn.timeline-sources.js
│ ├── popcorn.timeline-sources.unit.html
│ └── popcorn.timeline-sources.unit.js
├── parsers
├── parserJSON
│ ├── data
│ │ ├── audio.json
│ │ ├── data.json
│ │ └── video.json
│ ├── popcorn.parserJSON.html
│ ├── popcorn.parserJSON.js
│ ├── popcorn.parserJSON.unit.html
│ └── popcorn.parserJSON.unit.js
├── parserSBV
│ ├── data
│ │ └── data.sbv
│ ├── popcorn.parserSBV.html
│ ├── popcorn.parserSBV.js
│ ├── popcorn.parserSBV.unit.html
│ └── popcorn.parserSBV.unit.js
├── parserSRT
│ ├── data
│ │ ├── data.srt
│ │ └── unit.srt
│ ├── popcorn.parserSRT.html
│ ├── popcorn.parserSRT.js
│ ├── popcorn.parserSRT.unit.html
│ └── popcorn.parserSRT.unit.js
├── parserSSA
│ ├── data
│ │ └── data.ssa
│ ├── popcorn.parserSSA.html
│ ├── popcorn.parserSSA.js
│ ├── popcorn.parserSSA.unit.html
│ └── popcorn.parserSSA.unit.js
├── parserTTML
│ ├── data
│ │ ├── data.ttml
│ │ └── unit.ttml
│ ├── popcorn.parserTTML.html
│ ├── popcorn.parserTTML.js
│ ├── popcorn.parserTTML.unit.html
│ └── popcorn.parserTTML.unit.js
├── parserTTXT
│ ├── data
│ │ ├── data.TTXT
│ │ └── unit.TTXT
│ ├── popcorn.parserTTXT.html
│ ├── popcorn.parserTTXT.js
│ ├── popcorn.parserTTXT.unit.html
│ └── popcorn.parserTTXT.unit.js
├── parserVTT
│ ├── data
│ │ ├── data.vtt
│ │ └── unit.vtt
│ ├── popcorn.parserVTT.html
│ ├── popcorn.parserVTT.js
│ ├── popcorn.parserVTT.unit.html
│ └── popcorn.parserVTT.unit.js
└── parserXML
│ ├── data
│ ├── data.XML
│ └── unit.XML
│ ├── popcorn.parserXML.html
│ ├── popcorn.parserXML.js
│ ├── popcorn.parserXML.unit.html
│ └── popcorn.parserXML.unit.js
├── players
├── soundcloud
│ ├── popcorn.soundcloud.html
│ └── popcorn.soundcloud.js
├── vimeo
│ ├── popcorn.vimeo.html
│ ├── popcorn.vimeo.js
│ ├── popcorn.vimeo.unit.html
│ └── popcorn.vimeo.unit.js
└── youtube
│ ├── popcorn.youtube.html
│ └── popcorn.youtube.js
├── plugins
├── code
│ ├── popcorn.code.html
│ ├── popcorn.code.js
│ ├── popcorn.code.unit.html
│ └── popcorn.code.unit.js
├── documentcloud
│ ├── popcorn.documentcloud.html
│ ├── popcorn.documentcloud.js
│ ├── popcorn.documentcloud.unit.html
│ └── popcorn.documentcloud.unit.js
├── flickr
│ ├── popcorn.flickr.html
│ ├── popcorn.flickr.js
│ ├── popcorn.flickr.unit.html
│ └── popcorn.flickr.unit.js
├── footnote
│ ├── popcorn.footnote.html
│ ├── popcorn.footnote.js
│ ├── popcorn.footnote.unit.html
│ └── popcorn.footnote.unit.js
├── googlefeed
│ ├── popcorn.googlefeed.html
│ ├── popcorn.googlefeed.js
│ ├── popcorn.googlefeed.unit.html
│ └── popcorn.googlefeed.unit.js
├── googlemap
│ ├── popcorn.googlemap.html
│ ├── popcorn.googlemap.js
│ ├── popcorn.googlemap.unit.html
│ └── popcorn.googlemap.unit.js
├── image
│ ├── popcorn.image.html
│ ├── popcorn.image.js
│ ├── popcorn.image.unit.html
│ └── popcorn.image.unit.js
├── mediaspawner
│ ├── popcorn.mediaspawner.html
│ ├── popcorn.mediaspawner.js
│ ├── popcorn.mediaspawner.unit.html
│ └── popcorn.mediaspawner.unit.js
├── mustache
│ ├── popcorn.mustache.html
│ ├── popcorn.mustache.js
│ ├── popcorn.mustache.unit.html
│ └── popcorn.mustache.unit.js
├── openmap
│ ├── popcorn.openmap.html
│ ├── popcorn.openmap.js
│ ├── popcorn.openmap.unit.html
│ └── popcorn.openmap.unit.js
├── pause
│ ├── popcorn.pause.html
│ ├── popcorn.pause.js
│ ├── popcorn.pause.unit.html
│ └── popcorn.pause.unit.js
├── subtitle
│ ├── popcorn.subtitle.html
│ ├── popcorn.subtitle.js
│ ├── popcorn.subtitle.unit.html
│ └── popcorn.subtitle.unit.js
├── text
│ ├── popcorn.text.html
│ ├── popcorn.text.js
│ ├── popcorn.text.unit.html
│ └── popcorn.text.unit.js
├── timeline
│ ├── popcorn.timeline.html
│ ├── popcorn.timeline.js
│ ├── popcorn.timeline.unit.html
│ └── popcorn.timeline.unit.js
├── webpage
│ ├── popcorn.webpage.html
│ ├── popcorn.webpage.js
│ ├── popcorn.webpage.unit.html
│ └── popcorn.webpage.unit.js
├── wikipedia
│ ├── popcorn.wikipedia.html
│ ├── popcorn.wikipedia.js
│ ├── popcorn.wikipedia.unit.html
│ └── popcorn.wikipedia.unit.js
└── wordriver
│ ├── popcorn.wordriver.html
│ ├── popcorn.wordriver.js
│ ├── popcorn.wordriver.unit.html
│ └── popcorn.wordriver.unit.js
├── popcorn.js
├── readme.md
├── test
├── archaic.html
├── butter.unit.js
├── butter_test.html
├── core.html
├── data
│ ├── jsonp.json
│ ├── jsonp.php
│ ├── jsonpfancyapi.php
│ ├── method.php
│ ├── remoteA.js
│ ├── remoteB.js
│ ├── test.js
│ ├── test.ttml
│ ├── test.txt
│ ├── test.xml
│ ├── testfunction.js
│ └── testfunction2.js
├── index.html
├── inject.js
├── italia.mp4
├── italia.ogg
├── jquery.js
├── popcorn.inject.js
├── popcorn.testrunner.css
├── popcorn.testrunner.js
├── popcorn.unit.archaic.js
├── popcorn.unit.archaic.setup.js
├── popcorn.unit.js
├── popcorn.unit.setup.js
├── poster.png
├── qunit
│ ├── qunit.css
│ └── qunit.js
├── ready.html
├── silence.mp3
├── trailer.mp4
├── trailer.ogv
└── trailer.webm
├── tests.conf
├── tools
├── cleaner.js
├── jslint-cmdline.js
├── jslint.py
└── jsshellhelper.py
├── unsupported
├── attribution
│ ├── popcorn.attribution.html
│ ├── popcorn.attribution.js
│ ├── popcorn.attribution.unit.html
│ └── popcorn.attribution.unit.js
├── facebook
│ ├── popcorn.facebook.html
│ ├── popcorn.facebook.js
│ ├── popcorn.facebook.unit.html
│ └── popcorn.facebook.unit.js
├── gml
│ ├── popcorn.gml.html
│ ├── popcorn.gml.js
│ ├── popcorn.gml.unit.html
│ └── popcorn.gml.unit.js
├── lastfm
│ ├── popcorn.lastfm.html
│ ├── popcorn.lastfm.js
│ ├── popcorn.lastfm.unit.html
│ └── popcorn.lastfm.unit.js
├── linkedin
│ ├── popcorn.linkedin.html
│ ├── popcorn.linkedin.js
│ ├── popcorn.linkedin.unit.html
│ └── popcorn.linkedin.unit.js
├── lowerthird
│ ├── popcorn.lowerthird.html
│ ├── popcorn.lowerthird.js
│ ├── popcorn.lowerthird.unit.html
│ └── popcorn.lowerthird.unit.js
├── processing
│ ├── popcorn.processing.html
│ ├── popcorn.processing.js
│ ├── popcorn.processing.unit.html
│ ├── popcorn.processing.unit.js
│ ├── test.pjs
│ └── test2.pjs
├── rdio
│ ├── popcorn.rdio.html
│ ├── popcorn.rdio.js
│ ├── popcorn.rdio.unit.html
│ └── popcorn.rdio.unit.js
├── tagthisperson
│ ├── popcorn.tagthisperson.html
│ ├── popcorn.tagthisperson.js
│ ├── popcorn.tagthisperson.unit.html
│ └── popcorn.tagthisperson.unit.js
└── tumblr
│ ├── popcorn.tumblr.html
│ ├── popcorn.tumblr.js
│ ├── popcorn.tumblr.unit.html
│ └── popcorn.tumblr.unit.js
└── wrappers
├── common
├── common.unit.js
└── popcorn._MediaElementProto.js
├── html5
├── popcorn.HTMLMediaElement.js
├── popcorn.HTMLVideoElement.unit.html
└── popcorn.HTMLVideoElement.unit.js
├── jwplayer
├── popcorn.HTMLJWPlayerVideoElement.js
├── popcorn.HTMLJWPlayerVideoElement.unit.html
└── popcorn.HTMLJWPlayerVideoElement.unit.js
├── null
├── popcorn.HTMLNullVideoElement.js
├── popcorn.HTMLNullVideoElement.unit.html
└── popcorn.HTMLNullVideoElement.unit.js
├── soundcloud
├── popcorn.HTMLSoundCloudAudioElement.js
├── popcorn.HTMLSoundCloudAudioElement.unit.html
└── popcorn.HTMLSoundCloudAudioElement.unit.js
├── vimeo
├── popcorn.HTMLVimeoVideoElement.js
├── popcorn.HTMLVimeoVideoElement.unit.html
└── popcorn.HTMLVimeoVideoElement.unit.js
└── youtube
├── popcorn.HTMLYouTubeVideoElement.js
├── popcorn.HTMLYouTubeVideoElement.unit.html
└── popcorn.HTMLYouTubeVideoElement.unit.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | dist
3 | *~
4 | \.\#*
5 | \#*\#
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | Anna Sobiepanek
2 | Rick Waldron
3 | Scott Downe
4 | David Humphrey
5 | Nick Cammarata
6 | Daniel Hodgin
7 | Daniel Brooks
8 | Brett Gaylor
9 | Boaz Sender
10 | Dan Ventura
11 | Brad Chen
12 | Minoo Ziaei
13 | Cesar Gomes
14 | David Seifried
15 | Steven Weerdenburg
16 | Christopher De Cairos
17 | Mohammed Buttu
18 | Cole Gillespie
19 | Nick Doiron
20 | Bobby Richter
21 | Jon Buckley
22 | Matthew Schranz
23 | Brian Chirls
24 | Charlie Stigler
25 | Kate Hudson
26 | Denise Rigato
27 | Robert Stanica
28 |
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thank you for finding a bug in Popcorn.js, or having a feature request you'd like to see added.
2 |
3 | **Please Note:** Popcorn.js is no longer maintenance by mozilla, and as such: any bug you find will probably not get fixed until this project finds new owners/maintainers.
4 |
5 | If you think: "that's me!" then please get in touch and we can start the process of transferring ownership of this project to you!
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010, 2011 Mozilla Foundation
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/LICENSE_HEADER:
--------------------------------------------------------------------------------
1 | /*
2 | * popcorn.js version @VERSION
3 | * http://popcornjs.org
4 | *
5 | * Copyright 2011, Mozilla Foundation
6 | * Licensed under the MIT license
7 | */
8 |
9 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "popcorn-js",
3 | "version": "1.5.10",
4 | "main": "popcorn.js",
5 | "keywords": [
6 | "html5",
7 | "media",
8 | "video",
9 | "audio",
10 | "popcornjs",
11 | "popcorn",
12 | "popcorn.js"
13 | ],
14 | "ignore": [
15 | "AUTHORS",
16 | "CHANGELOG.md",
17 | "LICENSE_HEADER",
18 | "Makefile",
19 | "build",
20 | "demos",
21 | "effects",
22 | "example.html",
23 | "test",
24 | "tests.conf",
25 | "tools",
26 | "unsupported"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/build/google-compiler-20100917.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/build/google-compiler-20100917.jar
--------------------------------------------------------------------------------
/build/js.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/build/js.jar
--------------------------------------------------------------------------------
/build/jslint-check.js:
--------------------------------------------------------------------------------
1 | load("build/jslint.js");
2 |
3 | // All of the following are known issues that we think are 'ok'
4 | // (in contradiction with JSLint) more information here:
5 | // http://docs.jquery.com/JQuery_Core_Style_Guidelines
6 | var ok = {
7 | "Expected an identifier and instead saw 'undefined' (a reserved word).": true,
8 | "Use '===' to compare with 'null'.": true,
9 | "Use '!==' to compare with 'null'.": true,
10 | "Expected an assignment or function call and instead saw an expression.": true,
11 | "Expected a 'break' statement before 'case'.": true,
12 | "'e' is already defined.": true,
13 | "Don't make functions within a loop.": true,
14 | "['out'] is better written in dot notation.": true
15 | };
16 |
17 | function check(src)
18 | {
19 | JSLINT(src, { evil: true, forin: true, maxerr: 100 });
20 |
21 | var e = JSLINT.errors, found = 0, w;
22 | for ( var i = 0; e && i < e.length; i++ ) {
23 | w = e[i];
24 |
25 | if ( w && !ok[ w.reason ] ) {
26 | found++;
27 | print( "\n" + w.evidence + "\n" );
28 | print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
29 | }
30 | }
31 |
32 | if ( found > 0 ) {
33 | print( "\n" + found + " Error(s) found." );
34 | } else {
35 | print( "JSLint check passed." );
36 | }
37 | }
38 |
39 | for each (var f in arguments)
40 | {
41 | print( "Linting "+ f );
42 | check(readFile(f));
43 | }
44 |
--------------------------------------------------------------------------------
/demos/semantic_video/images/arro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/arro.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/body_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/body_bg.jpg
--------------------------------------------------------------------------------
/demos/semantic_video/images/bubble_pointer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/bubble_pointer.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/drumbeat_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/drumbeat_logo.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/expand_collapse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/expand_collapse.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/footer.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/footer.jpg
--------------------------------------------------------------------------------
/demos/semantic_video/images/footer_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/footer_bg.jpg
--------------------------------------------------------------------------------
/demos/semantic_video/images/footer_border.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/footer_border.jpg
--------------------------------------------------------------------------------
/demos/semantic_video/images/footer_drumbeat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/footer_drumbeat.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/footer_webmade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/footer_webmade.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/footnote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/footnote.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/header.jpg
--------------------------------------------------------------------------------
/demos/semantic_video/images/logo_flickr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/logo_flickr.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/logo_google_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/logo_google_news.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/logo_lastfm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/logo_lastfm.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/logo_tumblr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/logo_tumblr.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/logo_twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/logo_twitter.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/logo_wiki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/logo_wiki.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/overlay/flickr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/overlay/flickr.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/overlay/footnote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/overlay/footnote.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/overlay/lastfm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/overlay/lastfm.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/overlay/location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/overlay/location.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/overlay/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/overlay/twitter.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/overlay/wiki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/overlay/wiki.png
--------------------------------------------------------------------------------
/demos/semantic_video/images/video_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/demos/semantic_video/images/video_icon.png
--------------------------------------------------------------------------------
/demos/semantic_video/popcorn.applyclass.js:
--------------------------------------------------------------------------------
1 | // EFFECT: applyclass
2 |
3 | (function (Popcorn) {
4 |
5 | /**
6 | * apply css class to jquery selector
7 | * selector is relative to plugin target's id
8 | * so .overlay is actually jQuery( "#target .overlay")
9 | *
10 | * @param {Object} options
11 | *
12 | * Example:
13 | var p = Popcorn('#video')
14 | .footnote({
15 | start: 5, // seconds
16 | end: 15, // seconds
17 | text: 'This video made exclusively for drumbeat.org',
18 | target: 'footnotediv',
19 | effect: 'applyclass',
20 | applyclass: 'selector: class'
21 | })
22 | *
23 | */
24 |
25 | Popcorn.compose( "applyclass", {
26 |
27 | manifest: {
28 | about: {
29 | name: "Popcorn applyclass Effect",
30 | version: "0.1",
31 | author: "@scottdowne",
32 | website: "scottdowne.wordpress.com"
33 | },
34 | options: {}
35 | },
36 | _setup: function( options ) {
37 |
38 | options.classes = {};
39 | options.applyclass = options.applyclass || "";
40 |
41 | var classes = options.applyclass.replace( /\s/g, "" ).split( "," ),
42 | item = [],
43 | idx = 0, len = classes.length;
44 |
45 | for ( ; idx < len; idx++ ) {
46 |
47 | item = classes[ idx ].split( ":" );
48 |
49 | if ( item[ 0 ] ) {
50 | options.classes[ item[ 0 ] ] = item[ 1 ] || "";
51 | }
52 | }
53 | },
54 | start: function( event, options ) {
55 |
56 | var idx = 0, len = 0, elements;
57 |
58 | Popcorn.forEach( options.classes, function( key, val ) {
59 |
60 | elements = [];
61 |
62 | if ( key === "parent" ) {
63 |
64 | var item = document.querySelectorAll("#" + options.target )[ 0 ];
65 |
66 | item && item.parentNode && elements.push( item.parentNode );
67 | } else {
68 |
69 | elements = document.querySelectorAll("#" + options.target + " " + key );
70 | }
71 |
72 | for ( idx = 0, len = elements.length; idx < len; idx++ ) {
73 |
74 | var element = elements[ idx ];
75 | element.classList.toggle( val );
76 |
77 | setTimeout( function() {
78 |
79 | element.classList.toggle( val );
80 | }, 250 );
81 | }
82 | });
83 | }
84 | });
85 | })( Popcorn );
86 |
--------------------------------------------------------------------------------
/effects/applyclass/popcorn.applyclass.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn flash effect Demo
5 |
6 |
7 |
8 |
9 |
10 |
33 |
34 |
35 |
36 | A footnote with a css class displaying This video made exclusively for drumbeat.org' will appear at 5 seconds and disappear at 15 seconds.
37 | A footnote with a css class displaying 'Visit webmademovies.org for more details' will appear at 20 seconds and disappear at 45 seconds.
38 |
39 |
43 |
44 |
47 |
48 |
51 |
52 |
55 |
56 | Your user agent does not support the HTML5 Video element.
57 |
58 |
59 |
60 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/effects/applyclass/popcorn.applyclass.js:
--------------------------------------------------------------------------------
1 | // EFFECT: applyclass
2 |
3 | (function (Popcorn) {
4 |
5 | /**
6 | * apply css class to jquery selector
7 | * selector is relative to plugin target's id
8 | * so .overlay is actually jQuery( "#target .overlay")
9 | *
10 | * @param {Object} options
11 | *
12 | * Example:
13 | var p = Popcorn('#video')
14 | .footnote({
15 | start: 5, // seconds
16 | end: 15, // seconds
17 | text: 'This video made exclusively for drumbeat.org',
18 | target: 'footnotediv',
19 | effect: 'applyclass',
20 | applyclass: 'selector: class'
21 | })
22 | *
23 | */
24 |
25 | var toggleClass = function( event, options ) {
26 |
27 | var idx = 0, len = 0, elements;
28 |
29 | Popcorn.forEach( options.classes, function( key, val ) {
30 |
31 | elements = [];
32 |
33 | if ( key === "parent" ) {
34 |
35 | elements[ 0 ] = document.querySelectorAll("#" + options.target )[ 0 ].parentNode;
36 | } else {
37 |
38 | elements = document.querySelectorAll("#" + options.target + " " + key );
39 | }
40 |
41 | for ( idx = 0, len = elements.length; idx < len; idx++ ) {
42 |
43 | elements[ idx ].classList.toggle( val );
44 | }
45 | });
46 | };
47 |
48 | Popcorn.compose( "applyclass", {
49 |
50 | manifest: {
51 | about: {
52 | name: "Popcorn applyclass Effect",
53 | version: "0.1",
54 | author: "@scottdowne",
55 | website: "scottdowne.wordpress.com"
56 | },
57 | options: {}
58 | },
59 | _setup: function( options ) {
60 |
61 | options.classes = {};
62 | options.applyclass = options.applyclass || "";
63 |
64 | var classes = options.applyclass.replace( /\s/g, "" ).split( "," ),
65 | item = [],
66 | idx = 0, len = classes.length;
67 |
68 | for ( ; idx < len; idx++ ) {
69 |
70 | item = classes[ idx ].split( ":" );
71 |
72 | if ( item[ 0 ] ) {
73 | options.classes[ item[ 0 ] ] = item[ 1 ] || "";
74 | }
75 | }
76 | },
77 | start: toggleClass,
78 | end: toggleClass
79 | });
80 | })( Popcorn );
81 |
--------------------------------------------------------------------------------
/effects/applyclass/style.css:
--------------------------------------------------------------------------------
1 | .applyoverlay {
2 | z-index: 9001;
3 | top: 0px;
4 | left: 0px;
5 | opacity: 0.2;
6 | filter: alpha(opacity=20);
7 | height: 100%;
8 | width: 100%;
9 | background: red;
10 | position: absolute;
11 | }
12 |
13 | section {
14 | display: inline-block;
15 | }
16 |
17 | section.hover {
18 | -webkit-box-shadow: -1px 1px 1px #bdc7c6;
19 | -moz-box-shadow: -1px 1px 1px #bdc7c6;
20 | box-shadow: -1px 1px 1px #bdc7c6;
21 | border: 1px solid #333;
22 | -moz-transform: scale(1.02);-webkit-transform: scale(1.02);
23 | z-index: 999;
24 | background: #FFF;
25 | }
26 |
27 | .test1 {
28 | background: green
29 | }
30 |
31 | .test2 {
32 | -webkit-box-shadow: -1px 1px 1px #bdc7c6;
33 | -moz-box-shadow: -1px 1px 1px #bdc7c6;
34 | box-shadow: -1px 1px 1px #bdc7c6;
35 | border: 1px solid #333;
36 | }
37 |
--------------------------------------------------------------------------------
/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn Simple Demo
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
43 |
44 |
45 | Popcorn Simple Demo
46 | You should see a footnote "This video made exclusively for drumbeat.org" appear right away
47 | You should see a subtitle "this is a subtitle" appear at 1 sec away
48 |
49 |
53 |
56 |
59 | Your user agent does not support the HTML5 Video element.
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/ie8/popcorn.ie8.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn YouTube Player - IE8 Shim
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | Note about this set of tests:
30 |
31 |
32 |
33 | The test assumes that the YouTube video is mostly loaded, before it is run.
34 | Therefore, if failures occur for the first time, just run it again. Likely,
35 | failures would disappear the second time.
36 |
37 |
38 | There will be two separate youtube videos visible after the completion of these tests.
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/modules/locale/popcorn.locale.js:
--------------------------------------------------------------------------------
1 | (function( global, Popcorn ) {
2 |
3 | var navigator = global.navigator;
4 |
5 | // Initialize locale data
6 | // Based on http://en.wikipedia.org/wiki/Language_localisation#Language_tags_and_codes
7 | function initLocale( arg ) {
8 |
9 | var locale = typeof arg === "string" ? arg : [ arg.language, arg.region ].join( "-" ),
10 | parts = locale.split( "-" );
11 |
12 | // Setup locale data table
13 | return {
14 | iso6391: locale,
15 | language: parts[ 0 ] || "",
16 | region: parts[ 1 ] || ""
17 | };
18 | }
19 |
20 | // Declare locale data table
21 | var localeData = initLocale( navigator.userLanguage || navigator.language );
22 |
23 | Popcorn.locale = {
24 |
25 | // Popcorn.locale.get()
26 | // returns reference to privately
27 | // defined localeData
28 | get: function() {
29 | return localeData;
30 | },
31 |
32 | // Popcorn.locale.set( string|object );
33 | set: function( arg ) {
34 |
35 | localeData = initLocale( arg );
36 |
37 | Popcorn.locale.broadcast();
38 |
39 | return localeData;
40 | },
41 |
42 | // Popcorn.locale.broadcast( type )
43 | // Sends events to all popcorn media instances that are
44 | // listening for locale events
45 | broadcast: function( type ) {
46 |
47 | var instances = Popcorn.instances,
48 | length = instances.length,
49 | idx = 0,
50 | instance;
51 |
52 | type = type || "locale:changed";
53 |
54 | // Iterate all current instances
55 | for ( ; idx < length; idx++ ) {
56 | instance = instances[ idx ];
57 |
58 | // For those instances with locale event listeners,
59 | // trigger a locale change event
60 | if ( type in instance.data.events ) {
61 | instance.trigger( type );
62 | }
63 | }
64 | }
65 | };
66 | })( this, this.Popcorn );
--------------------------------------------------------------------------------
/modules/locale/popcorn.locale.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn Module: Locale
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
30 |
31 |
34 |
35 |
38 |
39 | Your user agent does not support the HTML5 Video element.
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/modules/locale/popcorn.locale.unit.js:
--------------------------------------------------------------------------------
1 | (function( Popcorn ) {
2 |
3 | module( "Popcorn Locale" );
4 |
5 | asyncTest( "Popcorn.locale object", function() {
6 |
7 | var api = {
8 | get: "function",
9 | set: "function",
10 | broadcast: "function"
11 | },
12 | locale = navigator.userLanguage || navigator.language,
13 | parts = locale.split( "-" ),
14 |
15 | stub = {
16 | iso6391: locale,
17 | language: parts[ 0 ],
18 | region: parts[ 1 ]
19 | },
20 | $pop = Popcorn( "#video" ),
21 | expects = 18,
22 | count = 0;
23 |
24 | expect( expects );
25 |
26 | function plus() {
27 | if ( ++count == expects ) {
28 | start();
29 | }
30 | }
31 |
32 | ok( Popcorn.locale, "Popcorn.locale exists");
33 | plus();
34 |
35 | equal( typeof Popcorn.locale, "object", "Popcorn.locale is an object" );
36 | plus();
37 |
38 | Popcorn.forEach( api, function( type, method ) {
39 | ok( Popcorn.locale[ method ], "Popcorn.locale." + method + "() exists" );
40 | plus();
41 | equal( typeof Popcorn.locale[ method ], type, "Popcorn.locale." + method + "() is a " + type );
42 | plus();
43 | });
44 |
45 | deepEqual( Popcorn.locale.get(), stub, "Popcorn.locale.get() === navigator.language (" + JSON.stringify( stub ) + ") whenever possible" );
46 | plus();
47 |
48 | Popcorn.forEach( Popcorn.locale.get(), function( val, prop ) {
49 | equal( val, stub[ prop ], "Popcorn.locale.get() locale matches stub" );
50 | plus();
51 | });
52 |
53 | locale = "fr-CA";
54 |
55 | // Setup "locale:changed" event listener
56 | $pop.listen( "locale:changed", function() {
57 |
58 | var parts = locale.split( "-" ),
59 | stub = {
60 | iso6391: locale,
61 | language: parts[ 0 ],
62 | region: parts[ 1 ]
63 | };
64 |
65 |
66 | Popcorn.forEach( Popcorn.locale.get(), function( val, prop ) {
67 | equal( val, stub[ prop ], "Popcorn.locale.set() -> get() locale matches updated stub" );
68 | plus();
69 | });
70 |
71 | if ( locale === "fr-CA" ) {
72 | locale = "en-CA";
73 |
74 | // Change locale, trigger "locale:changed" event
75 | Popcorn.locale.set( "en-CA" );
76 | }
77 | });
78 |
79 | // Change locale, trigger "locale:changed" event
80 | Popcorn.locale.set( "fr-CA" );
81 | });
82 |
83 | })( Popcorn );
--------------------------------------------------------------------------------
/modules/parser/data/parseMissing.json:
--------------------------------------------------------------------------------
1 | {
2 | "data": [
3 | {
4 | "parserMissing": {
5 | "start": 5,
6 | "end": 6
7 | }
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/modules/parser/data/parserAudio.json:
--------------------------------------------------------------------------------
1 | {
2 | "data": [
3 | {
4 | "testAudioParser": {
5 | "start": 5,
6 | "end": 6
7 | }
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/modules/parser/data/parserData.json:
--------------------------------------------------------------------------------
1 | {
2 | "data": [
3 | {
4 | "parserTest": {
5 | "start": 5,
6 | "end": 6
7 | }
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/modules/parser/popcorn.parser.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn Module: Timeline-Sources
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
30 |
31 |
34 |
35 |
38 |
39 | Your user agent does not support the HTML5 Video element.
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/modules/player/popcorn.player.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn Module: Timeline-Sources
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/modules/timeline-sources/popcorn.timeline-sources.js:
--------------------------------------------------------------------------------
1 | (function( Popcorn ) {
2 | document.addEventListener( "DOMContentLoaded", function() {
3 |
4 | // Supports non-specific elements
5 | var dataAttr = "data-timeline-sources",
6 | medias = document.querySelectorAll( "[" + dataAttr + "]" );
7 |
8 | Popcorn.forEach( medias, function( idx, key ) {
9 |
10 | var media = medias[ key ],
11 | hasDataSources = false,
12 | dataSources, data, popcornMedia;
13 |
14 | // Ensure that the DOM has an id
15 | if ( !media.id ) {
16 |
17 | media.id = Popcorn.guid( "__popcorn" );
18 | }
19 |
20 | // Ensure we're looking at a dom node
21 | if ( media.nodeType && media.nodeType === 1 ) {
22 |
23 | popcornMedia = Popcorn( "#" + media.id );
24 |
25 | dataSources = ( media.getAttribute( dataAttr ) || "" ).split( "," );
26 |
27 | if ( dataSources[ 0 ] ) {
28 |
29 | Popcorn.forEach( dataSources, function( source ) {
30 |
31 | // split the parser and data as parser!file
32 | data = source.split( "!" );
33 |
34 | // if no parser is defined for the file, assume "parse" + file extension
35 | if ( data.length === 1 ) {
36 |
37 | // parse a relative URL for the filename, split to get extension
38 | data = source.match( /(.*)[\/\\]([^\/\\]+\.\w+)$/ )[ 2 ].split( "." );
39 |
40 | data[ 0 ] = "parse" + data[ 1 ].toUpperCase();
41 | data[ 1 ] = source;
42 | }
43 |
44 | // If the media has data sources and the correct parser is registered, continue to load
45 | if ( dataSources[ 0 ] && popcornMedia[ data[ 0 ] ] ) {
46 |
47 | // Set up the media and load in the datasources
48 | popcornMedia[ data[ 0 ] ]( data[ 1 ] );
49 |
50 | }
51 | });
52 |
53 | }
54 |
55 | // Only play the media if it was specified to do so
56 | if ( !!popcornMedia.autoplay() ) {
57 | popcornMedia.play();
58 | }
59 |
60 | }
61 | });
62 | }, false );
63 |
64 | })( Popcorn );
--------------------------------------------------------------------------------
/modules/timeline-sources/popcorn.timeline-sources.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn Module: Timeline-Sources
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
29 |
30 |
33 |
34 |
37 |
38 |
41 |
42 | Your user agent does not support the HTML5 Video element.
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/modules/timeline-sources/popcorn.timeline-sources.unit.js:
--------------------------------------------------------------------------------
1 | (function( Popcorn ) {
2 |
3 | var setupCalled = 0,
4 | startCalled = 0,
5 | endCalled = 0;
6 |
7 | Popcorn.plugin( "footnote", function( options ) {
8 | return {
9 | _setup: function() {
10 | setupCalled++;
11 | },
12 | start: function() {
13 | startCalled++;
14 | },
15 | end: function() {
16 | endCalled++;
17 | }
18 | };
19 | });
20 |
21 | Popcorn.plugin( "googlemap", function( options ) {
22 | return {
23 | _setup: function() {
24 | setupCalled++;
25 | },
26 | start: function() {
27 | startCalled++;
28 | },
29 | end: function() {
30 | endCalled++;
31 | }
32 | };
33 | });
34 |
35 | Popcorn.plugin( "webpage", function( options ) {
36 | return {
37 | _setup: function() {
38 | setupCalled++;
39 | },
40 | start: function() {
41 | startCalled++;
42 | },
43 | end: function() {
44 | endCalled++;
45 | }
46 | };
47 | });
48 |
49 | test( "Timeline-sources Module", function() {
50 |
51 | var count = 0,
52 | expects = 4,
53 | p = Popcorn.instances[ 0 ].volume( 0 );
54 |
55 | expect( expects );
56 | function plus() {
57 | if ( ++count === expects ) {
58 | start();
59 | }
60 | }
61 |
62 | stop();
63 |
64 | p.exec( 3, function() {
65 | equal( startCalled, 5, "start was called 5 times from the parsed data" );
66 | plus();
67 | p.currentTime( 9 );
68 | });
69 |
70 | p.exec( 10.5, function() {
71 | equal( endCalled, 5, "end was called 5 times from the parsed data" );
72 | plus();
73 | });
74 |
75 | equal( setupCalled, 5, "setup was called 5 times from the parsed data" );
76 | plus();
77 |
78 | equal( p.paused(), true, "Only play the media if it was specified to do so" );
79 | plus();
80 |
81 | p.play();
82 | });
83 |
84 | })( Popcorn );
--------------------------------------------------------------------------------
/parsers/parserJSON/data/audio.json:
--------------------------------------------------------------------------------
1 | {
2 | "title":"Crockford Lives!",
3 | "remote":"http://dl.dropbox.com/u/3531958/crockford.ogv",
4 | "data": [
5 | {
6 | "webpage": {
7 | "start":"0.0897589878863602",
8 | "end":"2.001204869833337",
9 | "target":"audio-iframe-container",
10 | "src":"http://json.org"
11 | }
12 | },
13 | {
14 | "footnote": {
15 | "start":"0.23530116023787565",
16 | "end":"2.0193976413772767",
17 | "target":"audio-footnote-container",
18 | "text":"I invented JSON"
19 | }
20 | },
21 | {
22 | "googlemap": {
23 | "start":"0.09096385771969716",
24 | "end":"8.617349362660605",
25 | "target":"audio-map-container",
26 | "type":"ROADMAP",
27 | "lat":37.7749295,
28 | "lng":-122.4194155,
29 | "location":"San Francisco, CA"
30 | }
31 | },
32 | {
33 | "webpage": {
34 | "start":"2.073975956009095",
35 | "end":"10.278915922325776",
36 | "target":"audio-iframe-container",
37 | "src":"http://jslint.org"
38 | }
39 | },
40 | {
41 | "footnote": {
42 | "start":2.145542172351516,
43 | "end":10.145542172351513,
44 | "target":"audio-footnote-container",
45 | "text":"I wrote JSLint"
46 | }
47 | }
48 | ]
49 | }
50 |
--------------------------------------------------------------------------------
/parsers/parserJSON/data/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title":"Crockford Lives!",
3 | "remote":"http://dl.dropbox.com/u/3531958/crockford.ogv",
4 | "data": [
5 | {
6 | "webpage": {
7 | "start":"0.0897589878863602",
8 | "end":"2.001204869833337",
9 | "target":"iframe-container",
10 | "src":"http://json.org"
11 | }
12 | },
13 | {
14 | "footnote": {
15 | "start":"0.23530116023787565",
16 | "end":"2.0193976413772767",
17 | "target":"footnote-container",
18 | "text":"I invented JSON"
19 | }
20 | },
21 | {
22 | "googlemap": {
23 | "start":"0.09096385771969716",
24 | "end":"8.617349362660605",
25 | "target":"map-container",
26 | "type":"ROADMAP",
27 | "lat":37.7749295,
28 | "lng":-122.4194155,
29 | "location":"San Francisco, CA"
30 | }
31 | },
32 | {
33 | "webpage": {
34 | "start":"2.073975956009095",
35 | "end":"10.278915922325776",
36 | "target":"iframe-container",
37 | "src":"http://jslint.org"
38 | }
39 | },
40 | {
41 | "footnote": {
42 | "start":2.145542172351516,
43 | "end":10.145542172351513,
44 | "target":"footnote-container",
45 | "text":"I wrote JSLint"
46 | }
47 | }
48 | ]
49 | }
--------------------------------------------------------------------------------
/parsers/parserJSON/data/video.json:
--------------------------------------------------------------------------------
1 | {
2 | "title":"Crockford Lives!",
3 | "remote":"http://dl.dropbox.com/u/3531958/crockford.ogv",
4 | "data": [
5 | {
6 | "webpage": {
7 | "start":"0.0897589878863602",
8 | "end":"2.001204869833337",
9 | "target":"video-iframe-container",
10 | "src":"http://json.org"
11 | }
12 | },
13 | {
14 | "footnote": {
15 | "start":"0.23530116023787565",
16 | "end":"2.0193976413772767",
17 | "target":"video-footnote-container",
18 | "text":"I invented JSON"
19 | }
20 | },
21 | {
22 | "googlemap": {
23 | "start":"0.09096385771969716",
24 | "end":"8.617349362660605",
25 | "target":"video-map-container",
26 | "type":"ROADMAP",
27 | "lat":37.7749295,
28 | "lng":-122.4194155,
29 | "location":"San Francisco, CA"
30 | }
31 | },
32 | {
33 | "webpage": {
34 | "start":"2.073975956009095",
35 | "end":"10.278915922325776",
36 | "target":"video-iframe-container",
37 | "src":"http://jslint.org"
38 | }
39 | },
40 | {
41 | "footnote": {
42 | "start":2.145542172351516,
43 | "end":10.145542172351513,
44 | "target":"video-footnote-container",
45 | "text":"I wrote JSLint"
46 | }
47 | }
48 | ]
49 | }
50 |
--------------------------------------------------------------------------------
/parsers/parserJSON/popcorn.parserJSON.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn 1.0 JSON parser Plug-in Demo
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
27 |
28 |
31 |
32 | Your user agent does not support the HTML5 Video element.
33 |
34 |
35 |
36 |
37 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/parsers/parserJSON/popcorn.parserJSON.js:
--------------------------------------------------------------------------------
1 | // PARSER: 0.3 JSON
2 |
3 | (function (Popcorn) {
4 | Popcorn.parser( "parseJSON", "JSON", function( data ) {
5 |
6 | // declare needed variables
7 | var retObj = {
8 | title: "",
9 | remote: "",
10 | data: []
11 | },
12 | manifestData = {},
13 | dataObj = data;
14 |
15 |
16 | /*
17 | TODO: add support for filling in source children of the video element
18 |
19 |
20 | remote: [
21 | {
22 | src: "whatever.mp4",
23 | type: 'video/mp4; codecs="avc1, mp4a"'
24 | },
25 | {
26 | src: "whatever.ogv",
27 | type: 'video/ogg; codecs="theora, vorbis"'
28 | }
29 | ]
30 |
31 | */
32 |
33 |
34 | Popcorn.forEach( dataObj.data, function ( obj, key ) {
35 | retObj.data.push( obj );
36 | });
37 |
38 | return retObj;
39 | });
40 |
41 | })( Popcorn );
42 |
--------------------------------------------------------------------------------
/parsers/parserSBV/data/data.sbv:
--------------------------------------------------------------------------------
1 | 0:00:02.400,0:00:07.200
2 | Senator, we're making our final approach into Coruscant.
3 |
4 | 0:00:09.712,0:00:13.399
5 | Very good, Lieutenant.
6 |
7 | 0:00:15.042,0:00:18.042
8 | It's a trap!
9 |
--------------------------------------------------------------------------------
/parsers/parserSBV/popcorn.parserSBV.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn 1.0 SBV parser Plug-in Demo
5 |
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
21 |
22 |
23 | From 2.4 to 7.2 seconds, "Senator, we're making our final approach into Coruscant." is shown
24 | From 9.712 to 13.399 seconds, "Very good, Lieutenant." is shown
25 | From 15.042 to 18.042 seconds, "It's a trap!" is shown
26 |
27 |
28 |
32 |
33 |
36 |
37 |
40 |
41 | Your user agent does not support the HTML5 Video element.
42 |
43 |
44 |
45 |
46 | Subtitle Source
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/parsers/parserSBV/popcorn.parserSBV.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn SBV parser Plug-in Test
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
37 |
38 |
41 |
42 |
45 |
46 | Your user agent does not support the HTML5 Video element.
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/parsers/parserSBV/popcorn.parserSBV.unit.js:
--------------------------------------------------------------------------------
1 | asyncTest( "Popcorn 0.3 SBV Parser Plugin", function () {
2 |
3 | var count = 0,
4 | numSubs = 0,
5 | sub,
6 | poppercorn = Popcorn( "#video" ),
7 | subs = [
8 | {
9 | text: "Senator, we're making our final approach into Coruscant.",
10 | start: 2.4,
11 | end: 7.2
12 | },
13 | {
14 | text: "Very good, Lieutenant.",
15 | start: 9.712,
16 | end: 13.399
17 | },
18 | {
19 | text: "It's a trap!",
20 | start: 15.042,
21 | end: 18.042
22 | }
23 | ],
24 | expects = subs.length * 3 + 1;
25 |
26 | function plus() {
27 | if ( ++count === expects ) {
28 | start();
29 | }
30 | }
31 |
32 | poppercorn.parseSBV( "data/data.sbv", function (){
33 | expect(expects);
34 |
35 | Popcorn.forEach( poppercorn.getTrackEvents(), function( evt ) {
36 | if( evt._natives.type === "subtitle" ) {
37 | sub = subs[ numSubs++ ];
38 |
39 | equal( evt.start, sub.start, "Correctly parsed start of " + evt.start );
40 | plus();
41 | equal( evt.text, sub.text, "Correctly parsed text of " + evt.start );
42 | plus();
43 | equal( evt.end, sub.end, "Correctly parsed end at " + evt.start );
44 | plus();
45 | }
46 | });
47 |
48 | equal( subs.length, numSubs, "Parsed all subtitles" );
49 | plus();
50 | });
51 | });
52 |
--------------------------------------------------------------------------------
/parsers/parserSRT/data/data.srt:
--------------------------------------------------------------------------------
1 | 1
2 | 00:00:02.400 --> 00:00:05.200
3 | [Background Music Playing]
4 |
5 | 2
6 | 00:00:06.000 --> 00:00:13,700
7 | To say that 2 is greater than three (3 > 2) would be lying
8 |
9 | 3
10 | 00:00:15,712 --> 00:00:17,399 X1:000 X2:000 Y1:050 Y2:100
11 | Oh my god, Watch out!
12 | It's coming!!
13 |
14 | 4
15 | 00:00:25,712 --> 00:00:30,399
16 | [Bird noises]
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/parsers/parserSRT/data/unit.srt:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 00:00:02.400 --> 00:00:05.200
5 | [Background Music Playing]
6 |
7 | 2
8 | 00:00:15,712 --> 00:00:17,399 X1:000 X2:000 Y1:050 Y2:100
9 | Oh my god, Watch out!
10 | It's coming!!
11 |
12 | 3
13 | 00:00:25,712 --> 00:00:30,399
14 | [Bird noises]
15 |
16 | 4
17 | 00:00:31,000 --> 00:00:31,999
18 | This text is RED and has not been {\pos(142,120)}positioned.
19 |
20 | 5
21 | 00:00:32,000 --> 00:00:32,999
22 | This is a\nnew line, as is\Nthis
23 |
24 | 6
25 | 00:00:33,000 --> 00:00:33,999
26 | This contains nested bold, italic, underline and strike-through HTML tags
27 |
28 | 7
29 | 00:00:34,000 --> 00:00:34,999
30 | Unclosed but supported HTML tags are left in, {\i1} SSA italics aren't
31 |
32 | 8
33 | 00:00:35,000 --> 00:00:35,999
34 | Unsupported HTML tags are escaped and left in, even if not closed.
35 |
36 | 9
37 | 00:00:36,000 --> 00:00:36,999
38 | Multiple {\pos(142,120)\b1}SSA tags are stripped
39 |
40 | 10
41 | 00:00:37,000 --> 00:00:37,999
42 | Greater than (<) and less than (>) are shown
43 |
44 |
45 |
--------------------------------------------------------------------------------
/parsers/parserSRT/popcorn.parserSRT.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn 1.0 SRT parser Plug-in Demo
5 |
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
21 |
22 |
23 | From 2.4 to 5.2 seconds, "[Background Music Playing]" is shown
24 | From 6 to 13.7 seconds, "<true> To say that 2 is greater than three (3 > 2) would be lying<true>" is shown
25 | From 15.712 to 17.399 seconds, "Oh my god, Watch out! It's coming!!" is shown
26 | From 25.712 to 30.399 seconds, "[Bird noises]" is shown
27 |
28 |
29 |
33 |
34 |
37 |
38 |
41 |
42 | Your user agent does not support the HTML5 Video element.
43 |
44 |
45 |
46 |
47 | Subtitle Source
48 |
49 |
50 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/parsers/parserSRT/popcorn.parserSRT.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn SRT parser Plug-in Test
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
37 |
38 |
41 |
42 |
45 |
46 | Your user agent does not support the HTML5 Video element.
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/parsers/parserSSA/data/data.ssa:
--------------------------------------------------------------------------------
1 | [Script Info]
2 | Title: Testing subtitles for the SSA Format
3 |
4 | [V4 Styles]
5 | Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
6 | Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0
7 | Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0
8 | Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0
9 |
10 |
11 |
12 | [Events]
13 | Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
14 | Dialogue: 0,0:00:02.40,0:00:07.20,Default,,0000,0000,0000,,Senator, {\kf89}we're \Nmaking our final \napproach into Coruscant.
15 | Dialogue: 0,0:00:09.71,0:00:13.39,Default,,0000,0000,0000,,{\pos(400,570)}Very good, Lieutenant.
16 | Dialogue: 0,0:00:15.04,0:00:18.04,Default,,0000,0000,0000,,It's \Na \ntrap!
17 |
18 |
19 | [Pictures]
20 | This section will be ignored
21 |
22 | [Fonts]
23 | This section will be ignored
--------------------------------------------------------------------------------
/parsers/parserSSA/popcorn.parserSSA.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn 1.0 SSA parser Plug-in Demo
5 |
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
21 |
22 |
23 | From 2.4 to 7.2 seconds, "Senator, we're making our final approach into Coruscant." is shown
24 | From 9.71 to 13.39 seconds, "Very good, Lieutenant." is shown
25 | From 15.04 to 18.04 seconds, "It's a trap!" is shown
26 |
27 |
28 |
32 |
33 |
36 |
37 |
40 |
41 | Your user agent does not support the HTML5 Video element.
42 |
43 |
44 |
45 | Subtitle Source
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/parsers/parserSSA/popcorn.parserSSA.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn SSA parser Plug-in Test
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
37 |
38 |
41 |
42 |
45 |
46 | Your user agent does not support the HTML5 Video element.
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/parsers/parserSSA/popcorn.parserSSA.unit.js:
--------------------------------------------------------------------------------
1 | asyncTest( "Popcorn 0.3 SSA/ASS Parser Plugin", function () {
2 |
3 | var count = 0,
4 | numSubs = 0,
5 | sub,
6 | poppercorn = Popcorn( "#video" ),
7 | subs = [
8 | {
9 | text: "Senator, we're making our final approach into Coruscant.",
10 | start: 2.4,
11 | end: 7.2
12 | },
13 | {
14 | text: "Very good, Lieutenant.",
15 | start: 9.71,
16 | end: 13.39
17 | },
18 | {
19 | text: "It's a trap!",
20 | start: 15.04,
21 | end: 18.04
22 | }
23 | ],
24 | expects = subs.length * 3 + 1;
25 |
26 | function plus() {
27 | if ( ++count === expects ) {
28 | start();
29 | }
30 | }
31 |
32 | poppercorn.parseSSA( "data/data.ssa", function() {
33 |
34 | Popcorn.forEach( poppercorn.getTrackEvents(), function( evt ) {
35 | if( evt._natives.type === "subtitle" ) {
36 | sub = subs[ numSubs++ ];
37 |
38 | equal( evt.start, sub.start, "Correctly parsed start of " + evt.start );
39 | plus();
40 | equal( evt.text, sub.text, "Correctly parsed text of " + evt.start );
41 | plus();
42 | equal( evt.end, sub.end, "Correctly parsed end at " + evt.start );
43 | plus();
44 | }
45 | });
46 |
47 | equal( subs.length, numSubs, "Parsed all subtitles" );
48 | plus();
49 |
50 | });
51 |
52 | expect( expects );
53 |
54 | });
55 |
--------------------------------------------------------------------------------
/parsers/parserTTML/popcorn.parserTTML.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn 1.0 TTML parser Plug-in Test
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
32 |
33 |
36 |
37 |
40 |
41 |
44 |
45 | Your user agent does not support the HTML5 Video element.
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/parsers/parserTTXT/data/data.TTXT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/parsers/parserTTXT/data/unit.TTXT:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/parsers/parserTTXT/popcorn.parserTTXT.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn 1.0 TTXT parser Plug-in Demo
5 |
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
21 |
22 | Subtitles are processed from here
23 |
24 | From 2.4 to 5.2 seconds, "[Background Music Playing]" is shown
25 | From 15.712 to 17.399 seconds, "Heay!!" is shown
26 | From 25.712 to 30.399 seconds, "[Bird noises]" is shown
27 |
28 |
29 |
33 |
34 |
37 |
38 |
41 |
42 | Your user agent does not support the HTML5 Video element.
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/parsers/parserTTXT/popcorn.parserTTXT.js:
--------------------------------------------------------------------------------
1 | // PARSER: 0.1 TTXT
2 |
3 | (function (Popcorn) {
4 |
5 | /**
6 | * TTXT popcorn parser plug-in
7 | * Parses subtitle files in the TTXT format.
8 | * Style information is ignored.
9 | * Data parameter is given by Popcorn, will need an xml.
10 | * Xml is the file contents to be parsed as a DOM tree
11 | *
12 | * @param {Object} data
13 | *
14 | * Example:
15 |
16 | */
17 | Popcorn.parser( "parseTTXT", function( data ) {
18 |
19 | // declare needed variables
20 | var returnData = {
21 | title: "",
22 | remote: "",
23 | data: []
24 | };
25 |
26 | // Simple function to convert HH:MM:SS.MMM to SS.MMM
27 | // Assume valid, returns 0 on error
28 | var toSeconds = function(t_in) {
29 | var t = t_in.split(":");
30 | var time = 0;
31 |
32 | try {
33 | return parseFloat(t[0], 10)*60*60 + parseFloat(t[1], 10)*60 + parseFloat(t[2], 10);
34 | } catch (e) { time = 0; }
35 |
36 | return time;
37 | };
38 |
39 | // creates an object of all atrributes keyed by name
40 | var createTrack = function( name, attributes ) {
41 | var track = {};
42 | track[name] = attributes;
43 | return track;
44 | };
45 |
46 | // this is where things actually start
47 | var node = data.xml.lastChild.lastChild; // Last Child of TextStreamHeader
48 | var lastStart = Number.MAX_VALUE;
49 | var cmds = [];
50 |
51 | // Work backwards through DOM, processing TextSample nodes
52 | while (node) {
53 | if ( node.nodeType === 1 && node.nodeName === "TextSample") {
54 | var sub = {};
55 | sub.start = toSeconds(node.getAttribute('sampleTime'));
56 | sub.text = node.getAttribute('text');
57 |
58 | if (sub.text) { // Only process if text to display
59 | // Infer end time from prior element, ms accuracy
60 | sub.end = lastStart - 0.001;
61 | cmds.push( createTrack("subtitle", sub) );
62 | }
63 | lastStart = sub.start;
64 | }
65 | node = node.previousSibling;
66 | }
67 |
68 | returnData.data = cmds.reverse();
69 |
70 | return returnData;
71 | });
72 |
73 | })( Popcorn );
74 |
--------------------------------------------------------------------------------
/parsers/parserTTXT/popcorn.parserTTXT.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn TTXT parser Plug-in Test
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
37 |
38 |
41 |
42 |
45 |
46 | Your user agent does not support the HTML5 Video element.
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/parsers/parserTTXT/popcorn.parserTTXT.unit.js:
--------------------------------------------------------------------------------
1 | asyncTest( "Popcorn 0.3 TTXT Parser Plugin", function () {
2 |
3 | var expects = 0,
4 | count = 0,
5 | sub = {},
6 | numSubs = 0,
7 | poppercorn = Popcorn( "#video" ),
8 | subs = [ // Expected values
9 | {
10 | start: 2.4,
11 | end: 5.199,
12 | text: "[Background Music Playing]"
13 | },
14 | {
15 | start: 15.712,
16 | end: 17.398,
17 | text: "Heay!!"
18 | },
19 | {
20 | start: 25.712,
21 | end: 30.398,
22 | text: "[Bird noises]"
23 | }
24 | ];
25 |
26 | function plus() {
27 | if ( ++count === expects ) {
28 | start();
29 | }
30 | }
31 |
32 | poppercorn.parseTTXT( "data/unit.TTXT", function(){
33 |
34 | Popcorn.forEach( poppercorn.getTrackEvents(), function( evt ) {
35 | if( evt._natives.type === "subtitle" ) {
36 | sub = subs[ numSubs++ ];
37 |
38 | equal( sub.end, evt.end , "Correct end" );
39 | plus();
40 |
41 | equal( sub.start, evt.start , "Correct start" );
42 | plus();
43 |
44 | equal( sub.text, evt.text , "Correct text" );
45 | plus();
46 | }
47 | });
48 |
49 | equal( subs.length, numSubs , "Correctly parsed all subs" );
50 | plus();
51 |
52 | });
53 |
54 | expects = subs.length*3+1;
55 | expect(expects);
56 |
57 | });
58 |
--------------------------------------------------------------------------------
/parsers/parserVTT/data/data.vtt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/parsers/parserVTT/data/data.vtt
--------------------------------------------------------------------------------
/parsers/parserVTT/data/unit.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT
2 |
3 | 00:00:02.400 --> 00:00:07.200
4 | A typical multiline
5 | subtitle.
6 |
7 | 00:09.712-->00:13.399
8 | No whitespace between time tokens
9 |
10 |
11 |
12 | 00:00:13.400 --> 00:00:20
13 | A bad cue, no milliseconds. Should be ignored
14 |
15 | 00:00:9.456--> 00:00:20.000
16 | A bad cue, seconds are single digit. Should be ignored
17 |
18 | 00:1:00.456--> 00:00:20.000
19 | A bad cue, minutes are single digit. Should be ignored
20 |
21 | 1:00:00.456--> 00:00:20.000
22 | A bad cue, hours are supplied as single digit. Should be ignored
23 |
24 | 00:00:00.46--> 00:00:20.000
25 | A bad cue, ms are not 3 digits. Should be ignored
26 |
27 | 00:00:15.042 --> 00:00:18.042 A:start D:vertical L:98%
28 | It's a trap! Ignore the timeline styling for now!
29 |
30 |
31 | 00:00:20.000--> 00:00:21.670
32 | This text is boldy italicized
--------------------------------------------------------------------------------
/parsers/parserVTT/popcorn.parserVTT.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mozilla/popcorn-js/95162da9c4de6f7a1e200242c5ab7cc556b55f1a/parsers/parserVTT/popcorn.parserVTT.html
--------------------------------------------------------------------------------
/parsers/parserVTT/popcorn.parserVTT.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn WebSRT/VTT parser Plug-in Test
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
37 |
38 |
41 |
42 |
45 |
46 | Your user agent does not support the HTML5 Video element.
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/parsers/parserVTT/popcorn.parserVTT.unit.js:
--------------------------------------------------------------------------------
1 | asyncTest( "Popcorn 1.0 WebSRT/VTT Parser Plugin", function () {
2 |
3 | var count = 0,
4 | numSubs = 0,
5 | sub,
6 | poppercorn = Popcorn( "#video" ),
7 | expectedSubs = [
8 | {
9 | id: "00:00:02.400 --> 00:00:07.200",
10 | text: "A typical multiline subtitle.",
11 | start: 2.4,
12 | end: 7.2
13 | },
14 | {
15 | id: "00:09.712-->00:13.399",
16 | text: "No whitespace between time tokens",
17 | start: 9.712,
18 | end: 13.399
19 | },
20 | {
21 | id: "00:00:15.042 --> 00:00:18.042 A:start D:vertical L:98%",
22 | text: "It's a trap! Ignore the timeline styling for now!",
23 | start: 15.042,
24 | end: 18.042
25 | },
26 | {
27 | id: "00:00:20.000--> 00:00:21.670",
28 | text: "This text is boldy italicized ",
29 | start: 20.000,
30 | end: 21.670
31 | }
32 | ],
33 | expects = expectedSubs.length * 4 + 1;
34 |
35 | function plus() {
36 | if ( ++count === expects ) {
37 | start();
38 | }
39 | }
40 |
41 | poppercorn.parseVTT( "data/unit.vtt", function(){
42 |
43 | Popcorn.forEach( poppercorn.getTrackEvents(), function( evt ) {
44 | if( evt._natives.type === "subtitle" ) {
45 | sub = expectedSubs[ numSubs++ ];
46 |
47 | strictEqual( evt.id, sub.id, "Correctly parsed id" );
48 | plus();
49 | strictEqual( evt.text, sub.text, "Correctly parsed text of '" + evt.id + "'" );
50 | plus();
51 | strictEqual( evt.start, sub.start, "Correctly parsed start at '" + evt.id + "'" );
52 | plus();
53 | strictEqual( evt.end, sub.end, "Correctly parsed end at '" + evt.id + "'" );
54 | plus();
55 | }
56 | });
57 |
58 | equal( expectedSubs.length, numSubs, "Parsed all subtitles" );
59 | plus();
60 |
61 | });
62 |
63 | expect( expects );
64 |
65 | });
66 |
--------------------------------------------------------------------------------
/parsers/parserXML/data/data.XML:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/parsers/parserXML/data/unit.XML:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | item4
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/parsers/parserXML/popcorn.parserXML.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn 1.0 parser Plug-in Demo
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 |
22 |
25 |
26 |
29 |
30 | Your user agent does not support the HTML5 Video element.
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/parsers/parserXML/popcorn.parserXML.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn parser Plug-in Test
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
32 |
33 |
36 |
37 |
40 |
41 |
44 |
45 | Your user agent does not support the HTML5 Video element.
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/parsers/parserXML/popcorn.parserXML.unit.js:
--------------------------------------------------------------------------------
1 | asyncTest( "Popcorn 0.1 XML Parser Plugin", 7, function () {
2 |
3 | var poppercorn = Popcorn( "#video" );
4 |
5 | Popcorn.plugin( "parserTest1", {
6 | start: function ( event, options ) {
7 | ok( options.item2 === "item2", "parserTest1 has data directly from manifest" );
8 | ok( options.item3 === "item3", "parserTest1 has cascading data from manifest" );
9 | }
10 | });
11 |
12 | Popcorn.plugin( "parserTest2", {
13 | start: function ( event, options ) {
14 | ok( options.text === "item4", "parserTest2 has text data" );
15 | ok( options.item1 === "item1", "parserTest2 has cascading data from parent" );
16 | }
17 | });
18 |
19 | Popcorn.plugin( "parserTest3", {
20 | start: function ( event, options ) {
21 | ok( options.item1 === "item1", "parserTest3 has cascading data from parent" );
22 | ok( options.item2 === "item2", "parserTest3 has data directly from manifest" );
23 | ok( options.item3 === "item3", "parserTest3 has cascading data from manifest" );
24 | start();
25 | }
26 | });
27 |
28 | poppercorn.parseXML( "data/unit.XML", function() {
29 | poppercorn.play( 5 );
30 | poppercorn.mute();
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/players/soundcloud/popcorn.soundcloud.js:
--------------------------------------------------------------------------------
1 | (function( window, Popcorn ) {
2 |
3 | Popcorn.player( "soundcloud", {
4 | _canPlayType: function( nodeName, url ) {
5 | return ( typeof url === "string" &&
6 | Popcorn.HTMLSoundCloudAudioElement._canPlaySrc( url ) &&
7 | nodeName.toLowerCase() !== "audio" );
8 | }
9 | });
10 |
11 | Popcorn.soundcloud = function( container, url, options ) {
12 | if ( typeof console !== "undefined" && console.warn ) {
13 | console.warn( "Deprecated player 'soundcloud'. Please use Popcorn.HTMLSoundCloudAudioElement directly." );
14 | }
15 |
16 | var media = Popcorn.HTMLSoundCloudAudioElement( container ),
17 | popcorn = Popcorn( media, options );
18 |
19 | // Set the src "soon" but return popcorn instance first, so
20 | // the caller can get get error events.
21 | setTimeout( function() {
22 | media.src = url;
23 | }, 0 );
24 |
25 | return popcorn;
26 | };
27 |
28 | }( window, Popcorn ));
29 |
--------------------------------------------------------------------------------
/players/vimeo/popcorn.vimeo.js:
--------------------------------------------------------------------------------
1 | (function( window, Popcorn ) {
2 |
3 | Popcorn.player( "vimeo", {
4 | _canPlayType: function( nodeName, url ) {
5 | return ( typeof url === "string" &&
6 | Popcorn.HTMLVimeoVideoElement._canPlaySrc( url ) );
7 | }
8 | });
9 |
10 | Popcorn.vimeo = function( container, url, options ) {
11 | if ( typeof console !== "undefined" && console.warn ) {
12 | console.warn( "Deprecated player 'vimeo'. Please use Popcorn.HTMLVimeoVideoElement directly." );
13 | }
14 |
15 | var media = Popcorn.HTMLVimeoVideoElement( container ),
16 | popcorn = Popcorn( media, options );
17 |
18 | // Set the src "soon" but return popcorn instance first, so
19 | // the caller can get get error events.
20 | setTimeout( function() {
21 | media.src = url;
22 | }, 0 );
23 |
24 | return popcorn;
25 | };
26 |
27 | }( window, Popcorn ));
28 |
--------------------------------------------------------------------------------
/players/vimeo/popcorn.vimeo.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Vimeo Player Unit Test Suite
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/players/youtube/popcorn.youtube.js:
--------------------------------------------------------------------------------
1 | (function( window, Popcorn ) {
2 |
3 | var canPlayType = function( nodeName, url ) {
4 | return ( typeof url === "string" &&
5 | Popcorn.HTMLYouTubeVideoElement._canPlaySrc( url ) );
6 | };
7 |
8 | Popcorn.player( "youtube", {
9 | _canPlayType: canPlayType
10 | });
11 |
12 | Popcorn.youtube = function( container, url, options ) {
13 | if ( typeof console !== "undefined" && console.warn ) {
14 | console.warn( "Deprecated player 'youtube'. Please use Popcorn.HTMLYouTubeVideoElement directly." );
15 | }
16 |
17 | var media = Popcorn.HTMLYouTubeVideoElement( container ),
18 | popcorn = Popcorn( media, options );
19 |
20 | // Set the src "soon" but return popcorn instance first, so
21 | // the caller can listen for error events.
22 | setTimeout( function() {
23 | media.src = url;
24 | }, 0 );
25 |
26 | return popcorn;
27 | };
28 |
29 | Popcorn.youtube.canPlayType = canPlayType;
30 |
31 | }( window, Popcorn ));
32 |
--------------------------------------------------------------------------------
/plugins/code/popcorn.code.unit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Popcorn API
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
35 |
36 |
39 |
40 |
43 |
44 |
47 |
48 | Your user agent does not support the HTML5 Video element.
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/plugins/code/popcorn.code.unit.js:
--------------------------------------------------------------------------------
1 | test( "Popcorn Code Plugin", function() {
2 |
3 | var popped = Popcorn( "#video" ),
4 | expects = 11,
5 | count = 0,
6 | frames = 0,
7 | codeDiv = document.getElementById( "code-div" ),
8 | hasCheckedFrame = false;
9 |
10 | expect( expects );
11 |
12 | function plus() {
13 | if ( ++count === expects ) {
14 | start();
15 | }
16 | }
17 |
18 | stop();
19 |
20 | ok( "code" in popped, "code is a method of the popped instance" );
21 | plus();
22 |
23 | equal( codeDiv.innerHTML, "", "initially, there is nothing inside the code-div" );
24 | plus();
25 |
26 | popped.code({
27 | start: 0,
28 | end: 2,
29 | onStart: function( options ) {
30 | ok( this instanceof Popcorn, "this instanceof Popcorn, onStart" );
31 | plus();
32 | },
33 | onEnd: function( options ) {
34 | ok( this instanceof Popcorn, "this instanceof Popcorn, onEnd" );
35 | plus();
36 | }
37 | });
38 |
39 | popped.code({
40 | start: 0,
41 | end: 2,
42 | onStart: function( options ) {
43 | codeDiv.innerHTML = "Test 1 - onStart (no onEnd)";
44 | ok( true, "Test 1 onStart was run." );
45 | plus();
46 | }
47 | });
48 |
49 | popped.code({
50 | start: 2,
51 | end: 4,
52 | onStart: function( options ) {
53 | codeDiv.innerHTML = "Test 2 - onStart";
54 | ok( true, "Test 2 onStart was run." );
55 | plus();
56 | },
57 | onEnd: function ( options ) {
58 | codeDiv.innerHTML = "Test 2 - onEnd";
59 | ok( true, "Test 2 onEnd was run." );
60 | plus();
61 | }
62 | });
63 |
64 | popped.code({
65 | start: 4,
66 | end: 6,
67 | onStart: function( options ) {
68 | codeDiv.innerHTML = "Test 3 - onStart [Frames: ";
69 | ok( true, "Test 3 onStart was run." );
70 | plus();
71 | },
72 | onFrame: function ( options ) {
73 |
74 | if ( !hasCheckedFrame ) {
75 | hasCheckedFrame = true;
76 | ok( this instanceof Popcorn, "this instanceof Popcorn, onFrame" );
77 | plus();
78 | }
79 | codeDiv.innerHTML += ".";
80 | frames++;
81 | },
82 | onEnd: function ( options ) {
83 | codeDiv.innerHTML += "] Test 3 - onEnd";
84 | ok( true, "Test 3 onEnd was run." );
85 | plus();
86 | ok( frames > 1, "Test 3 onFrames was run." );
87 | plus();
88 | popped.pause();
89 | }
90 | });
91 |
92 | // empty track events should be safe
93 | Popcorn.plugin.debug = true;
94 | popped.code({});
95 |
96 | popped.volume( 0 );
97 | popped.play();
98 | });
99 |
--------------------------------------------------------------------------------
/plugins/documentcloud/popcorn.documentcloud.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
36 |
37 |
38 |
42 |
43 |
46 |
47 |
50 |
51 | Your user agent does not support the HTML5 Video element.
52 |
53 |
54 |
55 |
56 |