<script>
document.addEventListener('DOMContentLoaded', function () {
var p = Popcorn('#video')
+ .volume(0)
.play()
.googleMap({
- start: 5, // seconds
- end: 45, // seconds
+ start: 0, // seconds
+ end: 10, // seconds
type: 'ROADMAP',
target: 'map',
lat: 43.665429,
long: -79.403323,
zoom: 10
+ } )
+ .googleMap({
+ start: 15, // seconds
+ end: 50, // seconds
+ type: 'SATELLITE',
+ target: 'map2',
+ lat: -23.5489,
+ long: -46.6388,
+ zoom: 10
} );
}, false);
</script>
</head>
<body>
<h1 id="qunit-header">Popcorn google Map Plug-in Demo</h1>
- <p> A Google Map displaying Toronto, Ontario will appear at 5 seconds and disappear at 45 seconds.</p>
+ <p> A Google Map displaying Toronto, Ontario will appear at 0 seconds and disappear at 10 seconds.</p>
+ <p> A Google Map displaying Toronto, Ontario will appear at 15 seconds and disappear at 25 seconds.</p>
<div>
<video id='video'
controls preload='none'
</video>
</div>
- <div id="map" style="width:400px;height:400px"><p>Locations in this video:</p>
+ <div style="width:700px">
+ <div id="map" style="position:relative;float:left;width:300px;height:400px"><p>Locations in this video:</p></div>
+ <div id="map2" style="position:relative;float:left;width:300px;height:400px"><p>Locations in this video:</p></div>
</div>
</body>
</html>
--- /dev/null
+test("Popcorn Google Map Plugin", function () {
+
+ var popped = Popcorn("#video"),
+ expects = 5,
+ count = 0,
+ iframeInterval,
+ iframeInterval2,
+ iframeInterval3,
+ iframeInterval4;
+
+ expect(expects);
+
+ function plus() {
+ if ( ++count===expects) {
+ start();
+ }
+ }
+
+ stop();
+
+ ok ('footnote' in popped, "footnote is a mehtod of the popped instance");
+ plus();
+
+ ok ( document.getElementById('footnotediv').innerHTML === "", "initially, there is nothing inside the footnotediv" );
+ plus();
+ //equals( actual, expected, message ) instead of ok( boolean true, message )
+ popped.footnote({
+ start: 5, // seconds
+ end: 15, // seconds
+ text: 'This video made exclusively for drumbeat.org',
+ target: 'footnotediv'
+ } )
+ .footnote({
+ start: 35, // seconds
+ end: 45, // seconds
+ text: 'Visit webmademovies.org for more details',
+ target: 'footnotediv'
+ } )
+ .play();
+
+
+ interval = setInterval( function() {
+ if( popped.currentTime() > 5 && popped.currentTime() <= 15 ) {
+ ok (document.getElementById('footnotediv').innerHTML === "This video made exclusively for drumbeat.org", "footnote displaing correct information" );
+ plus();
+ clearInterval( interval );
+ }
+ }, 5000);
+
+ interval2 = setInterval( function() {
+ if( popped.currentTime() > 15 && popped.currentTime() < 35 ) {
+ ok (document.getElementById('footnotediv').innerHTML === "", "footnote cleared properly" );
+ plus();
+ clearInterval( interval2 );
+ }
+ }, 5000);
+
+ interval3 = setInterval( function() {
+ if( popped.currentTime() > 35 && popped.currentTime() < 45 ) {
+ ok (document.getElementById('footnotediv').innerHTML === "Visit webmademovies.org for more details", "footnote displaing correct information" );
+ plus();
+ clearInterval( interval3 );
+ }
+ }, 5000);
+
+});