]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#384]Made a few styling changes, beginning more work on monday/over the weekend
authorDavid Seifried <david.c.seifried@gmail.com>
Fri, 3 Jun 2011 21:39:05 +0000 (17:39 -0400)
committerDavid Seifried <david.c.seifried@gmail.com>
Fri, 3 Jun 2011 21:39:05 +0000 (17:39 -0400)
plugins/timeline/popcorn.timeline.css [new file with mode: 0644]
plugins/timeline/popcorn.timeline.html [new file with mode: 0644]
plugins/timeline/popcorn.timeline.js [new file with mode: 0644]

diff --git a/plugins/timeline/popcorn.timeline.css b/plugins/timeline/popcorn.timeline.css
new file mode 100644 (file)
index 0000000..cb94c54
--- /dev/null
@@ -0,0 +1,52 @@
+@charset "UTF-8";
+body {
+font-family: "Helvetica Neue", Helvetica, Arial;
+font-size:12px;
+}
+
+#footer {
+width: 100%;
+height: 20px;
+position: fixed;
+text-align:right;
+right: 0px;
+overflow: hidden;
+background-color:#000000;
+color: white;
+top: 0;
+border-bottom: 1px solid #333;
+padding: 10px;
+}
+#playback {
+width: 700px;
+left: 0px;
+top: 0px;
+z-index:100;
+}
+
+#details2 {
+color: #fff;
+padding: 7px;
+right: 0px;
+top: 0px;
+line-height: 180%;
+}
+#details3 {
+padding: 7px;
+right: 0px;
+top: 0px;
+line-height: 180%;
+border-top: 1px solid #333;
+}
+#big {
+font-size:24px;
+line-height: 130%;
+}
+#mid {
+font-size: 16px;
+}
+
+// Thanks again to Nic for this css
+
+
+
diff --git a/plugins/timeline/popcorn.timeline.html b/plugins/timeline/popcorn.timeline.html
new file mode 100644 (file)
index 0000000..498162e
--- /dev/null
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Popcorn Google Feed Plug-in Demo</title>
+  
+  <script src="../../popcorn.js"></script>
+  <script src="popcorn.timeline.js"></script>
+  <script src="popcorn.timeline.css"></script>
+  <script>
+    document.addEventListener('DOMContentLoaded', function () {
+      var p = Popcorn('#video')
+      .volume(0)
+      .play()
+      .timeline({
+        start: 1, // seconds
+        end: 700,
+        target: "timeline",
+        title: "This is a title",
+        text: "this is some interesting text that goes inside",
+        links: "and heres a link"
+      } )
+      .timeline({
+        start: 3, // seconds
+        end: 700,
+        target: "timeline",
+        title: "and more interesting shit",
+        text: "this is some interesting text that goes inside",
+        links: "and heres a link"
+      } )
+     .timeline({
+        start: 7, // seconds
+        end: 700,
+        target: "timeline",
+        title: "3x as interesting",
+        text: "this is some interesting text that goes inside",
+        links: "and heres a link"
+      } )
+     .timeline({
+        start: 9, // seconds
+        end: 700,
+        target: "timeline",
+        title: "4x as interesting",
+        text: "this is some interesting text that goes inside",
+        links: "and heres a link"
+      } )
+      .timeline({
+        start: 14, // seconds
+        end: 700,
+        target: "timeline",
+        title: "5x as interesting",
+        text: "this is some interesting text that goes inside",
+        links: "and heres a link"
+      } )
+      .timeline({
+        start: 18, // seconds
+        end: 700,
+        target: "timeline",
+        title: "6x as interesting",
+        text: "this is some interesting text that goes inside",
+        links: "and heres a link"
+      } );
+    }, false);
+  </script>
+</head>
+<body>
+  <h1 id="qunit-header">Popcorn Timeline Plug-in Demo</h1>
+  <p>Continuos timeline elements will be added to the div throughout the video</p>
+  <div>
+    <video id='video'
+      controls
+      width= '250px'
+      poster="../../test/poster.png">
+
+      <source id='mp4'
+        src="../../test/trailer.mp4"
+        type='video/mp4; codecs="avc1, mp4a"'>
+
+      <source id='ogv'
+        src="../../test/trailer.ogv"
+        type='video/ogg; codecs="theora, vorbis"'>
+
+      <p>Your user agent does not support the HTML5 Video element.</p>
+
+    </video>
+  </div>
+  <div style="width:1000px">
+    <div id="timeline" style="float:left;width:400px;height:200px;overflow:auto"><p>Vertical Feed:</p></div>
+  </div>
+</body>
+</html>
diff --git a/plugins/timeline/popcorn.timeline.js b/plugins/timeline/popcorn.timeline.js
new file mode 100644 (file)
index 0000000..7d98c0c
--- /dev/null
@@ -0,0 +1,68 @@
+// PLUGIN: Timeline
+(function (Popcorn) {
+
+  var i = 0;
+   
+  var head = document.getElementsByTagName("head")[0];
+  var css = document.createElement('link');
+  css.type = "text/css";
+  css.rel = "stylesheet";
+  css.href = "asdf.css";
+  head.insertBefore( css, head.firstChild );
+
+
+  Popcorn.plugin( "timeline" , function( options ) {
+
+    // create a new div and append it to the parent div so nothing
+    // that already exists in the parent div gets overwritten
+    var newdiv = document.createElement( "div" );
+    newdiv.style.display = "none";
+    newdiv.id = "timelineDiv"+i;
+
+    if ( document.getElementById( options.target ) ) {
+
+      document.getElementById( options.target ).appendChild( newdiv );
+
+      // if this isnt the first div added to the target div
+      if( i ){
+
+        // insert the current div before the previous div inserted
+        document.getElementById( options.target ).insertBefore( newdiv, document.getElementById( "timelineDiv" + ( i - 1 ) ) );
+       }
+    }
+    
+    i++;
+    
+    newdiv.innerHTML = "<p><span id='big'>" + options.title + "</span><br />" +
+    "<span id='mid'>" + options.text + "<br />" +
+    "</span><a href='#'>" + options.links + "</a></p>";
+    
+    return {
+
+      start: function( event, options ){
+        newdiv.setAttribute( "style", "display:block" );
+      },
+ 
+      end: function(event, options){
+        newdiv.setAttribute( "style", "display:none" );
+      }
+    };
+  },
+  {
+
+    about: {
+      name: "Popcorn Timeline Plugin",
+      version: "0.1",
+      author: "David Seifried @dcseifried",
+      website: "dseifried.wordpress.com"
+    },
+
+    options: {
+      start :  { elem:"input", type:"text", label:"In" },
+      end :    { elem:"input", type:"text", label:"Out" },
+      target : "feed-container",
+      text :   { elem:"input", type:"text", label:"text" }
+    }
+  });
+  
+})( Popcorn );