]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
added iframe support [#114 state:peer-review-requested]
authorAnna Sobiepanek <annaopensource@gmail.com>
Thu, 14 Oct 2010 18:03:49 +0000 (14:03 -0400)
committerAnna Sobiepanek <annaopensource@gmail.com>
Thu, 14 Oct 2010 18:06:39 +0000 (14:06 -0400)
demos/semantic_video/index.html
demos/semantic_video/xml/webMadeMovies.xml
popcorn.js

index d0ca8579d50f586bcc67bde3073ab1cdb29159a8..7c5fab594137ae84e67e493d28c3d7600d88dcd0 100644 (file)
               <!-- End Video Info -->
             </div>
             <!-- End Video Div -->
+            
+            <div>
+              <section>
+                <a href="#" class="collapse"><span>Collapse</span></a>
+                <div id="iframes" class="content"><div class="overlay"></div><div class="inactive"></div></div>
+              </section>
+            </div>
+            
             <h1>
               <span>In this video: <strong id="inthisvideo"></strong></span>
             </h1>
index 54dd089b0edabaf0c03775952b46378cb64ca39c..9dfad3f31f5bda7493b9aa397fe6080df7faa14a 100644 (file)
@@ -9,7 +9,7 @@
       <person id="SteveSong" name="Steve Song" >
       </person>
       <person id="mona" name="Mona" >
-        <resource id="monahomepage" src="http://monakasra.com/" description="Mona's Homepage"/>
+        <resource id="monahomepage" src="http://www.monakasra.com/" description="Mona's Homepage"/>
       </person>
       <person id="dave" name="Dave" >
       </person>
         <subtitle in="00:04:37:07" out="00:04:38:06">along the way.</subtitle>
         <subtitle in="00:04:39:02" out="00:04:40:08">Explore our credits section to see</subtitle>
         <subtitle in="00:04:41:00" out="00:04:45:00">how you can get involved.</subtitle>
-
-
       </subtitles>
       <subtitles language="fa" align="center">
         <subtitle in="00:04:00:08" out="00:04:01:09">My name is Mona Kasra</subtitle>
         <subtitle in="00:04:08:07" out="00:04:10:01">using Creative Commons</subtitle>
       </subtitles>
     </subtitles>
+    <webpages>
+      <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>
   </timeline>
 </popcorn>
index 04726d4204886b9f1ea8cfd01d79d8cd2f747d1a..085f2e0ec648cf46a24ab7015b06de021c1ee0fc 100644 (file)
       this.videoManager.videoElement.currentTime = this.params.seekto;
     };
   };
+  ////////////////////////////////////////////////////////////////////////////
+  // WebPage Command
+  ////////////////////////////////////////////////////////////////////////////
+  
+  Popcorn.WebPageCommand = function(name, params, text, videoManager) {
+    Popcorn.VideoCommand.call(this, name, params, text, videoManager);
+
+    // Setup a default, iframe to hold the website
+    var target = document.createElement('iframe');
+    target.setAttribute('src', this.params.src);
+    target.setAttribute('width', this.params.width);
+    target.setAttribute('height', this.params.height);
+    target.setAttribute('id', this.id);
+    document.getElementById(this.params.target).appendChild(target);
+    // iframe is hidden by default
+    target.setAttribute('style', 'display:none');
+    // toggle display of the iframe 
+    this.target = target;
+    this.onIn = function() {
+      this.target.setAttribute('style', 'display:inline');
+    };
+    this.onOut = function() {
+      this.target.setAttribute('style', 'display:none');
+    };
+  };
   
   // Wrapper for accessing commands by name
   // commands[name].create() returns a new command of type name
       create: function(name, params, text, videoManager) {
         return new Popcorn.SeekCommand(name, params, text, videoManager);
       }
+    },
+    webpage: {
+      create: function(name, params, text, videoManager) {
+        return new Popcorn.WebPageCommand(name, params, text, videoManager);
+      }
     }
   };