<script src="popcorn.webpage.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
- var p = Popcorn('#video');
-
- p.play();
-
- p.webpages({
+ var p = Popcorn('#video')
+ .play()
+ .webpages({
id: "webpages-a",
start: 0, // seconds
end: 5, // seconds
<head>
<title>Popcorn API</title>
<link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
- <script src="../../test/jquery.js"></script>
<script src="../../test/qunit/qunit.js"></script>
<!--
do not move - this must be called immediately prior to
-$(function(){
+test("Popcorn Webpage Plugin", function () {
+
+
+ // needs expectation
- test("Popcorn Webpage Plugin", function () {
+ var popped = Popcorn("#video"),
+ expects = 4,
+ count = 0;
+
+ expect(expects);
+
+ function plus (){
+ if(++count === expects){
+ stop();
+ }
+ }
+
+ popped.webpages({
+ id: "webpages-a",
+ start: 0, // seconds
+ end: 5, // seconds
+ src: 'http://www.webmademovies.org',
+ target: 'webpagediv'
+ });
-
- // needs expectation
-
- var popped = Popcorn("#video");
-
- popped.webpages();
-
-
- ok( 'data' in popped, "popped has the data prop and therefore is a Popcorn object" )
-
- ok( 'webpages' in popped, "webpages is a mehtod of the popped instance");
-
- ok( typeof popped.webpages === "function" , "webpages is in the plugins registry");
-
-
- });
-});
\ No newline at end of file
+ popped.play();
+
+
+ ok( 'data' in popped, "popped has the data prop and therefore is a Popcorn object" )
+
+ ok( 'webpages' in popped, "webpages is a mehtod of the popped instance");
+
+ ok( typeof popped.webpages === "function" , "webpages is a function");
+
+ popped.exec(2, function(){
+ ok( document.getElementById('webpages-a') , "iframe exists");
+ })
+});