Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge commit 'origin/iframe'
Conflicts:
	popcorn.js
  • Loading branch information
annasob committed Oct 14, 2010
2 parents 4b9ec76 + ced92ce commit c34fd2e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
8 changes: 8 additions & 0 deletions demos/semantic_video/index.html
Expand Up @@ -168,6 +168,14 @@ <h2>This video's footnotes</h2>
<!-- 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>
Expand Down
8 changes: 5 additions & 3 deletions demos/semantic_video/xml/webMadeMovies.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -304,8 +304,6 @@
<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>
Expand All @@ -317,6 +315,10 @@
<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>
31 changes: 31 additions & 0 deletions popcorn.js
Expand Up @@ -1003,6 +1003,32 @@
};
};

////////////////////////////////////////////////////////////////////////////
// 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
// Not sure if this is the best way; maybe it's too fancy?
Expand Down Expand Up @@ -1076,6 +1102,11 @@
script: {
create: function(name, params, text, videoManager) {
return new Popcorn.ScriptCommand(name, params, text, videoManager);
}
},
webpage: {
create: function(name, params, text, videoManager) {
return new Popcorn.WebPageCommand(name, params, text, videoManager);
}
}
};
Expand Down

0 comments on commit c34fd2e

Please sign in to comment.