Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #11 from videojs/feature/abort
Browse files Browse the repository at this point in the history
Call into the SWF on abort()
  • Loading branch information
dmlap committed May 27, 2014
2 parents 513c9c4 + d042c81 commit c1b0f3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-qunit": "^0.4.0",
"qunitjs": "^1.14.0",
"video.js": "^4.4"
},
"peerDependencies": {
"video.js": "^4.4"
"video.js": "git+ssh://[email protected]:dmlap/video-js.git#0.6.1-alpha"
}
}
1 change: 1 addition & 0 deletions src/videojs-media-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
this.abort = function() {
buffer = [];
bufferSize = 0;
this.source.swfObj.vjs_abort();
};
};
videojs.SourceBuffer.prototype = new EventEmitter();
Expand Down
6 changes: 5 additions & 1 deletion test/media-sources_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
mediaSource.swfObj = {
CallFunction: function(xml) {
swfCalls.push(xml);
},
vjs_abort: function() {
swfCalls.push('abort');
}
};
player.src({
Expand Down Expand Up @@ -121,6 +124,7 @@
sourceBuffer.abort();

timers.pop()();
strictEqual(swfCalls.length, 0, 'made no appends');
strictEqual(swfCalls.length, 1, 'called the swf');
strictEqual(swfCalls[0], 'abort', 'invoked abort');
});
})(window, window.document, window.videojs);

0 comments on commit c1b0f3b

Please sign in to comment.