]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
moved credits into semantic video, andout of library
authorScottDowne <sdowne@learn.senecac.on.ca>
Mon, 18 Oct 2010 17:26:58 +0000 (13:26 -0400)
committerScottDowne <sdowne@learn.senecac.on.ca>
Mon, 18 Oct 2010 17:26:58 +0000 (13:26 -0400)
.gitignore
demos/semantic_video/index.html
demos/semantic_video/xml/webMadeMovies.xml
popcorn.js

index 98ce14f5322d251b544021b117bf0627b6d353fc..51f2adfb5c4864f7178c57f3419f1f6c865202c0 100644 (file)
@@ -1 +1 @@
-tools/*.pyc
+tools/jsshellhelper.pyc
index 7e82b8cef968a1579b1c12dc0ac7955ed0071121..3cdf5b0424c72c61f93b3e3b5e64384e3c3e2557 100644 (file)
@@ -10,6 +10,7 @@
   <script>google.load("language", "1");</script>
   <script>google.load("elements", "1", {packages : ["newsshow"]});</script>
   <script src="../../popcorn.js"></script>
+
   <link href="style.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript">
     $(document).ready(function () {
                 <div id="credit_inner">
                 </div>
               </div>
+                <script>
+
+                ////////////////////////////////////////////////////////////////////////////
+                // Credits
+                ////////////////////////////////////////////////////////////////////////////
+
+                  $("#credits")
+                      .width(530)
+                      .height(299);
+                  var displayCredits = function() {
+                      $("#credits").show();
+                      $("#choices").animate({ right:'+=200px' }, 1000);
+                      add( [
+                          { 
+                              text: "Play Again",
+                              click:function() {
+                                  killCol(0);
+                                  $('video')[0].currentTime=0;
+                              }
+                          },
+                          {
+                              text: "People",
+                              next :[
+                                  {
+                                      text: "Steve Song", href: "http://www.google.ca/"
+                                  },
+                                  {
+                                      text: "Jeffrey Warren"
+                                  },
+                                  {
+                                      text: "Michael Adeyeye"
+                                  },
+                                  {
+                                      text: "Charlie Schmidt"
+                                  },
+                                  {
+                                      text: "Jonathan Zittrain"
+                                  },
+                                  {
+                                      text: "Mona Kasra"
+                                  },
+                                  {
+                                      text: "Noah Workman"
+                                  },
+                                  {
+                                      text: "Wilken Sanches"
+                                  },
+                                  {
+                                      text: "Keechang Kim"
+                                  },
+                                  {
+                                      text: "Celine Celines"
+                                  }
+                              ]
+                          },
+                          {
+                              text: "Places",
+                              next: [
+                                  {
+                                      text: "Sao Paulo", href: "http://en.wikipedia.org/wiki/S%C3%A3o_Paulo"
+                                  },
+                                  {
+                                      text: "Cape Town", href: "http://en.wikipedia.org/wiki/Cape_Town"
+                                  },
+                                  {
+                                      text: "Grande Isle, Louisiana", href: "http://en.wikipedia.org/wiki/Grand_Isle,_Louisiana"
+                                  },
+                                  {
+                                      text: "MIT Media Lab", href: "http://www.media.mit.edu/"
+                                  },
+                                  {
+                                      text: "Austin, Texas", href: "http://en.wikipedia.org/wiki/Austin,_Texas"
+                                  },
+                                  {
+                                      text: "New York, New York", href: "http://en.wikipedia.org/wiki/New_York_City"
+                                  },
+                                  {
+                                      text: "Seoul, Republic of South Korea", href: "http://en.wikipedia.org/wiki/Seoul"
+                                  },
+                                  {
+                                      text: "Montreal, Quebec", href: "http://en.wikipedia.org/wiki/Montreal"
+                                  },
+                                  {
+                                      text: "Harvard Law School", href: "http://www.law.harvard.edu/index.html"
+                                  }
+                              ]
+                          },
+                          {
+                              text: "Articles",
+                              next: [
+                                  {
+                                      text: "The Internet", href: "http://en.wikipedia.org/wiki/internet"
+                                  },
+                                  {
+                                      text: "The Village Telco", href: "http://en.wikipedia.org/wiki/Village_telco"
+                                  },
+                                  {
+                                      text: "Deepwater Horizon Oil Spill", href: "http://en.wikipedia.org/wiki/Deepwater_Horizon_oil_spill"
+                                  },
+                                  {
+                                      text: "Jonathan Zittrain", href: "http://en.wikipedia.org/wiki/Jonathan_Zittrain"
+                                  },
+                                  {
+                                      text: "Compuserve", href: "http://en.wikipedia.org/wiki/Compuserve"
+                                  },
+                                  {
+                                      text: "AOL", href: "http://en.wikipedia.org/wiki/AOL"
+                                  },
+                                  {
+                                      text: "Prodigy", href: "http://en.wikipedia.org/wiki/Prodigy_%28online_service%29"
+                                  },
+                                  {
+                                      text: "Internet Protocol", href: "http://en.wikipedia.org/wiki/Internet_Protocol"
+                                  },
+                                  {
+                                      text: "Tim Berners-Lee", href: "http://en.wikipedia.org/wiki/Tim_Berners-Lee"
+                                  },
+                                  {
+                                      text: "World Wide Web", href: "http://en.wikipedia.org/wiki/World_wide_web"
+                                  },
+                                  {
+                                      text: "Wikipedia", href: "http://en.wikipedia.org/wiki/Wikipedia"
+                                  },
+                                  {
+                                      text: "Open Standards", href: "http://en.wikipedia.org/wiki/Open_Standards"
+                                  }
+                              ]    
+                          },
+                          {
+                              text: "Developers",
+                              next: [
+                                  {
+                                      text: "Brett Gaylor",
+                                      next: [
+                                          { text: "Twitter", href: "http://twitter.com/remixmanifesto"},
+                                          { text: "Email", href: "mailto:brett@eyesteelfilm.com"}
+                                      ]
+                                  },
+                                  {
+                                       text: "Scott Downe",
+                                       next:  [{ text: "Email", href: "mailto:scott.downe@senecac.on.ca" }]
+                                  },
+                                  
+                                  {
+                                      text: "Nick Cammarata",
+                                      next: [
+                                          { text: "Twitter", href: "http://twitter.com/nicklovescode"},
+                                          { text: "Email", href: "mailto:nick@nickcammarata.com"}
+                                      ]
+                                  },
+                                  {
+                                      text: "Anna Sobiepanek",
+                                      next: [
+                                          { text: "Twitter", href: "http://twitter.com/annasob"},
+                                          { text: "Email", href: "mailto:anna.sobiepanek@gmail.com"}
+                                      ]
+                                  },
+                                  {
+                                      text: "Daniel Hodgin",
+                                      next: [
+                                          { text: "Twitter", href: "http://twitter.com/dhhodgin"},
+                                          { text: "Email", href: "mailto:daniel.hodgin@senecac.on.ca"}
+                                      ]
+                                  },
+                                  {
+                                      text: "David Humphrey",
+                                      next: [
+                                          { text: "Twitter", href: "http://twitter.com/humphd"},
+                                          { text: "Email", href: "mailto:david.humphrey@senecac.on.ca"}
+                                      ]
+                                  }
+                              ]
+                          },
+                          { 
+                              text: "Sources",
+                              next: [
+                                  
+                              ]
+                          }
+                      ]);
+                  };
+                  var removeCredits = function() {
+                      $("#choices").css("right","-200px");
+                      $("#credits").hide();
+                  };
+                  var colIndex = 0;
+                  var killCol = function(index, callback) {
+                    $(".column").each(function() {
+                      if ($(this).attr("colindex")>index) {
+                        $(this).addClass("removing").animate( { left: -$(this).outerWidth() + "px" }, 1200, function() {
+                          $(this).remove(); 
+                        });
+                      }
+                    });
+                    if (callback) {
+                      callback();
+                    }
+                  };
+
+                  var add =  function(items) {
+                        colIndex++;
+                        var ul = $("<ul></ul>")
+                            .addClass('column')
+                            .attr('colindex',parseInt(colIndex, 10));
+                        $.each(items, function(i, val) {
+                            var li = $(document.createElement('li'))
+                                .append($(document.createElement('a'))
+                                    .text(val.text)
+                                    .attr("href",val.href||"#")
+                                    .attr("target",val.href?"_blank":""))
+                                .appendTo(ul)
+                                .addClass('play')
+                                .click(function() {
+                                    if (val.href) {
+                                      return true;
+                                    }
+                                    var colIndex2 = $(this).parent().attr('colindex');
+                                    if (colIndex>colIndex2) {
+                                        killCol(colIndex2);
+                                        colIndex = colIndex2;
+                                    }
+                                    var hasClass = $(this).hasClass('selected');
+                                    if (!hasClass) {
+                                        if (val.click) {
+                                          val.click();
+                                        }
+                                        if (val.next) {
+                                          add(val.next);
+                                        }
+                                    }  
+                                    $(this)
+                                       .parent()
+                                       .find('.selected')
+                                       .removeClass('selected');
+                                    if (!hasClass) {
+                                      $(this).addClass('selected');
+                                    }
+                                });
+                        });
+                        var width = 0;
+                        $(".column:not(.removing)").each(function() {
+                            width+=$(this).outerWidth();    
+                        });
+                        ul
+                            .appendTo("#credit_inner")
+                            .css("z-index",1000 - colIndex)
+                            .css("left",-ul.outerWidth())
+                            .animate({ 
+                                left: width + "px"
+                            },750);
+                  };
+              </script>
               <video width="530" height="299" data-timeline-sources="xml/webMadeMovies.xml" controls>
-                <source src="http://webmademovies.etherworks.ca/popcorndemo/wmmjuly6.ogv" type='video/ogg; codecs="theora, vorbis"'>
+                <source src="../../../wmmjuly6.ogv" type='video/ogg; codecs="theora, vorbis"'>
                 <source src="http://webmademovies.etherworks.ca/popcorndemo/wmmjuly6.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
               </video>
               <div id="overlaydiv" style="position:absolute;top:1px;left:1px"></div>
index 9dfad3f31f5bda7493b9aa397fe6080df7faa14a..7aab96f21b257ca1683cb6010db93c3024d9f47e 100644 (file)
       <webpage in="00:04:00:08" out="00:04:19:00" target="iframes" resourceid="monahomepage" width="100%" height="100%"></webpage>
       <webpage in="00:04:19:06" out="00:04:24:01" target="iframes" resourceid="celinehomepage" width="100%" height="100%"></webpage>
     </webpages>
-    <credits></credits>
+    <script in="4:45:00" start="displayCredits" stop="removeCredits"/>
   </timeline>
 </popcorn>
index 5a38c2cc1621f40568b345282a5af28196197792..0c2994035410f862e20b8baf47b963984da88dfe 100644 (file)
     };
   };
 
-  ////////////////////////////////////////////////////////////////////////////
-  // Credits Command
-  ////////////////////////////////////////////////////////////////////////////
-  popcorn.CreditsCommand = function(name, params, text, videoManager) {
-    popcorn.VideoCommand.call(this, name, params, text, videoManager);
-    $("#credits")
-        .width(this.videoManager.videoElement.clientWidth)
-        .height(this.videoManager.videoElement.clientHeight);
-    this.params["in"]=this.videoManager.videoElement.duration-0.1;
-    this.params["out"]=this.videoManager.videoElement.duration+0.1;
-    var that = this;
-    this.onIn = function() {
-        $("#credits").show();
-        $("#choices").animate({ right:'+=200px' }, 1000);
-        popcorn.CreditsCommand.add( [
-            { 
-                text: "Play Again",
-                click:function() {
-                    popcorn.CreditsCommand.killCol(0);
-                    $('video')[0].currentTime=0;
-                }
-            },
-            {
-                text: "People",
-                next :[
-                    {
-                        text: "Steve Song", href: "http://www.google.ca/"
-                    },
-                    {
-                        text: "Jeffrey Warren"
-                    },
-                    {
-                        text: "Michael Adeyeye"
-                    },
-                    {
-                        text: "Charlie Schmidt"
-                    },
-                    {
-                        text: "Jonathan Zittrain"
-                    },
-                    {
-                        text: "Mona Kasra"
-                    },
-                    {
-                        text: "Noah Workman"
-                    },
-                    {
-                        text: "Wilken Sanches"
-                    },
-                    {
-                        text: "Keechang Kim"
-                    },
-                    {
-                        text: "Celine Celines"
-                    }
-                ]
-            },
-            {
-                text: "Places",
-                next: [
-                    {
-                        text: "Sao Paulo", href: "http://en.wikipedia.org/wiki/S%C3%A3o_Paulo"
-                    },
-                    {
-                        text: "Cape Town", href: "http://en.wikipedia.org/wiki/Cape_Town"
-                    },
-                    {
-                        text: "Grande Isle, Louisiana", href: "http://en.wikipedia.org/wiki/Grand_Isle,_Louisiana"
-                    },
-                    {
-                        text: "MIT Media Lab", href: "http://www.media.mit.edu/"
-                    },
-                    {
-                        text: "Austin, Texas", href: "http://en.wikipedia.org/wiki/Austin,_Texas"
-                    },
-                    {
-                        text: "New York, New York", href: "http://en.wikipedia.org/wiki/New_York_City"
-                    },
-                    {
-                        text: "Seoul, Republic of South Korea", href: "http://en.wikipedia.org/wiki/Seoul"
-                    },
-                    {
-                        text: "Montreal, Quebec", href: "http://en.wikipedia.org/wiki/Montreal"
-                    },
-                    {
-                        text: "Harvard Law School", href: "http://www.law.harvard.edu/index.html"
-                    }
-                ]
-            },
-            {
-                text: "Articles",
-                next: [
-                    {
-                        text: "The Internet", href: "http://en.wikipedia.org/wiki/internet"
-                    },
-                    {
-                        text: "The Village Telco", href: "http://en.wikipedia.org/wiki/Village_telco"
-                    },
-                    {
-                        text: "Deepwater Horizon Oil Spill", href: "http://en.wikipedia.org/wiki/Deepwater_Horizon_oil_spill"
-                    },
-                    {
-                        text: "Jonathan Zittrain", href: "http://en.wikipedia.org/wiki/Jonathan_Zittrain"
-                    },
-                    {
-                        text: "Compuserve", href: "http://en.wikipedia.org/wiki/Compuserve"
-                    },
-                    {
-                        text: "AOL", href: "http://en.wikipedia.org/wiki/AOL"
-                    },
-                    {
-                        text: "Prodigy", href: "http://en.wikipedia.org/wiki/Prodigy_%28online_service%29"
-                    },
-                    {
-                        text: "Internet Protocol", href: "http://en.wikipedia.org/wiki/Internet_Protocol"
-                    },
-                    {
-                        text: "Tim Berners-Lee", href: "http://en.wikipedia.org/wiki/Tim_Berners-Lee"
-                    },
-                    {
-                        text: "World Wide Web", href: "http://en.wikipedia.org/wiki/World_wide_web"
-                    },
-                    {
-                        text: "Wikipedia", href: "http://en.wikipedia.org/wiki/Wikipedia"
-                    },
-                    {
-                        text: "Open Standards", href: "http://en.wikipedia.org/wiki/Open_Standards"
-                    }
-                ]    
-            },
-            {
-                text: "Developers",
-                next: [
-                    {
-                        text: "Brett Gaylor",
-                        next: [
-                            { text: "Twitter", href: "http://twitter.com/remixmanifesto"},
-                            { text: "Email", href: "mailto:brett@eyesteelfilm.com"}
-                        ]
-                    },
-                    {
-                         text: "Scott Downe",
-                         next:  [{ text: "Email", href: "mailto:scott.downe@senecac.on.ca" }]
-                    },
-                    
-                    {
-                        text: "Nick Cammarata",
-                        next: [
-                            { text: "Twitter", href: "http://twitter.com/nicklovescode"},
-                            { text: "Email", href: "mailto:nick@nickcammarata.com"}
-                        ]
-                    },
-                    {
-                        text: "Anna Sobiepanek",
-                        next: [
-                            { text: "Twitter", href: "http://twitter.com/annasob"},
-                            { text: "Email", href: "mailto:anna.sobiepanek@gmail.com"}
-                        ]
-                    },
-                    {
-                        text: "Daniel Hodgin",
-                        next: [
-                            { text: "Twitter", href: "http://twitter.com/dhhodgin"},
-                            { text: "Email", href: "mailto:daniel.hodgin@senecac.on.ca"}
-                        ]
-                    },
-                    {
-                        text: "David Humphrey",
-                        next: [
-                            { text: "Twitter", href: "http://twitter.com/humphd"},
-                            { text: "Email", href: "mailto:david.humphrey@senecac.on.ca"}
-                        ]
-                    }
-                ]
-            },
-            { 
-                text: "Sources",
-                next: [
-                    
-                ]
-            }
-        ]);
-    };
-    this.onOut = function() {
-        $("#choices").css("right","-200px");
-        $("#credits").hide();
-    };
-  };
-  popcorn.CreditsCommand.colIndex = 0;
-  popcorn.CreditsCommand.killCol = function(index, callback) {
-    $(".column").each(function() {
-      if ($(this).attr("colindex")>index) {
-        $(this).addClass("removing").animate( { left: -$(this).outerWidth() + "px" }, 1200, function() {
-          $(this).remove(); 
-        });
-      }
-    });
-    if (callback) {
-      callback();
-    }
-  };
-
-  popcorn.CreditsCommand.add =  function(items) {
-        popcorn.CreditsCommand.colIndex++;
-        var ul = $("<ul></ul>")
-            .addClass('column')
-            .attr('colindex',parseInt(popcorn.CreditsCommand.colIndex, 10));
-        $.each(items, function(i, val) {
-            var li = $(document.createElement('li'))
-                .append($(document.createElement('a'))
-                    .text(val.text)
-                    .attr("href",val.href||"#")
-                    .attr("target",val.href?"_blank":""))
-                .appendTo(ul)
-                .addClass('play')
-                .click(function() {
-                    if (val.href) {
-                      return true;
-                    }
-                    var colIndex = $(this).parent().attr('colindex');
-                    if (popcorn.CreditsCommand.colIndex>colIndex) { 
-                        popcorn.CreditsCommand.killCol(colIndex);
-                        popcorn.CreditsCommand.colIndex = colIndex;
-                    }
-                    var hasClass = $(this).hasClass('selected');
-                    if (!hasClass) {
-                        if (val.click) {
-                          val.click();
-                        }
-                        if (val.next) {
-                          popcorn.CreditsCommand.add(val.next);
-                        }
-                    }  
-                    $(this)
-                       .parent()
-                       .find('.selected')
-                       .removeClass('selected');
-                    if (!hasClass) {
-                      $(this).addClass('selected');
-                    }
-                });
-        });
-        var width = 0;
-        $(".column:not(.removing)").each(function() {
-            width+=$(this).outerWidth();    
-        });
-        ul
-            .appendTo("#credit_inner")
-            .css("z-index",1000 - popcorn.CreditsCommand.colIndex)
-            .css("left",-ul.outerWidth())
-            .animate({ 
-                left: width + "px"
-            },750);
-  };
-
   ////////////////////////////////////////////////////////////////////////////
   // TagThisPerson Command
   ////////////////////////////////////////////////////////////////////////////
          var htmlString = '';
        
     // This uses jquery
-       $.getJSON("http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist="+ this.params.artist +"&api_key=30ac38340e8be75f9268727cb4526b3d&format=json&callback=?",
-         function(data){
-                 htmlString += '<h3>'+data.artist.name+'</h3>';
-           htmlString += '<a href="'+data.artist.url+'" target="_blank" style="float:left;margin:0 10px 0 0;"><img src="'+ data.artist.image[2]['#text'] +'" alt=""></a>';
-                 htmlString += '<p>'+ data.artist.bio.summary +'</p>';
-                 htmlString += '<hr /><p><h4>Tags</h4><ul>';
-                 $.each(data.artist.tags.tag, function(i,val) {
-                   htmlString += '<li><a href="'+ this.url +'">'+ this.name +'</a></li>';
-                 });
-                 htmlString += '</ul></p>';
-                 htmlString += '<hr /><p><h4>Similar</h4><ul>';
-                 $.each(data.artist.similar.artist, function(i,val) {
-                   htmlString += '<li><a href="'+ this.url +'">'+ this.name +'</a></li>';
-                 });
-                 htmlString += '</ul></p>';
-           target.innerHTML = htmlString;
-         }
-       );
+         $.getJSON("http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist="+ this.params.artist +"&api_key=30ac38340e8be75f9268727cb4526b3d&format=json&callback=?",
+           function(data){
+                   htmlString += '<h3>'+data.artist.name+'</h3>';
+             htmlString += '<a href="'+data.artist.url+'" target="_blank" style="float:left;margin:0 10px 0 0;"><img src="'+ data.artist.image[2]['#text'] +'" alt=""></a>';
+                   htmlString += '<p>'+ data.artist.bio.summary +'</p>';
+                   htmlString += '<hr /><p><h4>Tags</h4><ul>';
+                   $.each(data.artist.tags.tag, function(i,val) {
+                     htmlString += '<li><a href="'+ this.url +'">'+ this.name +'</a></li>';
+                   });
+                   htmlString += '</ul></p>';
+                   htmlString += '<hr /><p><h4>Similar</h4><ul>';
+                   $.each(data.artist.similar.artist, function(i,val) {
+                     htmlString += '<li><a href="'+ this.url +'">'+ this.name +'</a></li>';
+                   });
+                   htmlString += '</ul></p>';
+             target.innerHTML = htmlString;
+           }
+         );
        
     this.target = target;
     this.onIn = function() {
         return new popcorn.SubtitleCommand(name, params, text, videoManager);
       }
     },
-    credits: {
-      create: function(name, params, text, videoManager) {
-        return new popcorn.CreditsCommand(name, params, text, videoManager);
-      }
-    },
     flickr: {
       create: function(name, params, text, videoManager) {
         return new popcorn.FlickrCommand(name, params, text, videoManager);