From 640fc4b15e0aba6768d5abd98e8db38af59a97c0 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Wed, 5 Jan 2011 12:22:54 -0500 Subject: [PATCH] [#221] initial data-timeline-sources --- parsers/parserXML/data.XML | 9 --------- parsers/parserXML/popcorn.parseXML.html | 13 +++---------- parsers/parserXML/unit.XML | 21 --------------------- popcorn.js | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 40 deletions(-) delete mode 100644 parsers/parserXML/data.XML delete mode 100644 parsers/parserXML/unit.XML diff --git a/parsers/parserXML/data.XML b/parsers/parserXML/data.XML deleted file mode 100644 index a1657d5..0000000 --- a/parsers/parserXML/data.XML +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/parsers/parserXML/popcorn.parseXML.html b/parsers/parserXML/popcorn.parseXML.html index 2b7f45f..ea9c159 100644 --- a/parsers/parserXML/popcorn.parseXML.html +++ b/parsers/parserXML/popcorn.parseXML.html @@ -7,22 +7,14 @@ -

Popcorn 0.1 parser Plug-in Demo

-
+ diff --git a/parsers/parserXML/unit.XML b/parsers/parserXML/unit.XML deleted file mode 100644 index c7efe8c..0000000 --- a/parsers/parserXML/unit.XML +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - item4 - - - - - - diff --git a/popcorn.js b/popcorn.js index 56e94e8..435cfb8 100644 --- a/popcorn.js +++ b/popcorn.js @@ -852,4 +852,19 @@ // Exposes Popcorn to global context global.Popcorn = Popcorn; + document.addEventListener('DOMContentLoaded', function () { + + var video = document.getElementsByTagName( 'video' ); + for ( var i = 0, l = video.length; i < l; i++ ) { + var ind = i, + videoSources = video[ind].getAttribute( 'data-timeline-sources' ); + if (videoSources) { + var p = Popcorn('#' + video[ind].getAttribute( 'id' ) ) + .parseXML( videoSources ) + .play(); + } + } + + }, false); + })(window, window.document); -- 2.43.0