mirror of
https://github.com/videojs/video.js.git
synced 2025-07-15 01:34:23 +02:00
@nickygerritsen added canPlayType method to player. closes #2709
This commit is contained in:
committed by
Gary Katsevman
parent
c85b526a1c
commit
589cab7fa7
@ -155,6 +155,27 @@ test('should have the source handler interface', function() {
|
||||
ok(Html5.registerSourceHandler, 'has the registerSourceHandler function');
|
||||
});
|
||||
|
||||
test('native source handler canPlayType', function(){
|
||||
var result;
|
||||
|
||||
// Stub the test video canPlayType (used in canPlayType) to control results
|
||||
var origCPT = Html5.TEST_VID.canPlayType;
|
||||
Html5.TEST_VID.canPlayType = function(type){
|
||||
if (type === 'video/mp4') {
|
||||
return 'maybe';
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
var canPlayType = Html5.nativeSourceHandler.canPlayType;
|
||||
|
||||
equal(canPlayType('video/mp4'), 'maybe', 'Native source handler reported type support');
|
||||
equal(canPlayType('foo'), '', 'Native source handler handled bad type');
|
||||
|
||||
// Reset test video canPlayType
|
||||
Html5.TEST_VID.canPlayType = origCPT;
|
||||
});
|
||||
|
||||
test('native source handler canHandleSource', function(){
|
||||
var result;
|
||||
|
||||
|
Reference in New Issue
Block a user