c39a821a by David LaPalomento

Only support HLS MIME types. Fixes #82.

Do not advertise support for MIME types that the underlying Flash tech happens to support.
1 parent d7c2b800
......@@ -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);
......