}
if ( !( "end" in options ) ) {
- options.end = this.duration();
+ var duration = this.duration();
+ options.end = duration ? duration : Number.MAX_VALUE;
}
// If a _setup was declared, then call it before
<script src="popcorn.unit.setup.js"></script>
<script src="../popcorn.js"></script>
+ <script src="../players/baseplayer/popcorn.baseplayer.js"></script>
<script src="popcorn.unit.js"></script>
</head>
<body>
});
});
+test("Defaulting Empty End Values", function() {
+
+ expect (2);
+
+ Popcorn.plugin("testdefault", {
+ _setup: function( options ) {
+ equals( options.end, Number.MAX_VALUE, "The end value defaulted to maximum number value");
+ },
+ start: function(event, options) {
+
+ },
+ end: function(event, options) {
+
+ }
+ });
+
+ var popped = Popcorn( Popcorn.baseplayer() )
+ .play()
+ .testdefault({
+ start: 0, // seconds
+ apikey: "CHAyhB5IisvLqqzGYNYbmA",
+ mediaid: "13607892"
+ });
+
+ var popped2 = Popcorn(document.createElement("video"))
+ .play()
+ .testdefault({
+ start: 0, // seconds
+ apikey: "CHAyhB5IisvLqqzGYNYbmA",
+ mediaid: "13607892"
+ });
+});
+
module("Popcorn TrackEvents");
test("Functions", function () {