c93a4788 by David LaPalomento

Merge pull request #85 from videojs/hotfix/canPlaySource

Only support HLS MIME types. Fixes #82.
2 parents d7c2b800 c39a821a
......@@ -529,7 +529,7 @@ videojs.Hls.isSupported = function() {
};
videojs.Hls.canPlaySource = function(srcObj) {
return mpegurlRE.test(srcObj.type) || videojs.Flash.canPlaySource.call(this, srcObj);
return mpegurlRE.test(srcObj.type);
};
/**
......
......@@ -1066,4 +1066,20 @@ test('disposes the playlist loader', function() {
strictEqual(disposes, 1, 'disposed playlist loader');
});
test('only supports HLS MIME types', function() {
ok(videojs.Hls.canPlaySource({
type: 'aPplicatiOn/x-MPegUrl'
}), 'supports x-mpegurl');
ok(videojs.Hls.canPlaySource({
type: 'aPplicatiOn/VnD.aPPle.MpEgUrL'
}), 'supports vnd.apple.mpegurl');
ok(!videojs.Hls.canPlaySource({
type: 'video/mp4'
}), 'does not support mp4');
ok(!videojs.Hls.canPlaySource({
type: 'video/x-flv'
}), 'does not support flv');
});
})(window, window.videojs);
......