Skip to content

Commit

Permalink
fix(player): Refined support for HLS.js by not including Safari as pa…
Browse files Browse the repository at this point in the history
…rt of the supported browsers
  • Loading branch information
rafa8626 committed Sep 14, 2018
1 parent 6be3400 commit 9df28f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/openplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ exports.SUPPORTS_HLS = function () {
var sourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;
var isTypeSupported = mediaSource && typeof mediaSource.isTypeSupported === 'function' && mediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
var sourceBufferValidAPI = !sourceBuffer || sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === 'function' && typeof sourceBuffer.prototype.remove === 'function';
return !!isTypeSupported && !!sourceBufferValidAPI;
return !!isTypeSupported && !!sourceBufferValidAPI && !exports.IS_SAFARI;
};

/***/ }),
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/js/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,8 @@ export const SUPPORTS_HLS = () => {
(sourceBuffer.prototype &&
typeof sourceBuffer.prototype.appendBuffer === 'function' &&
typeof sourceBuffer.prototype.remove === 'function');
return !!isTypeSupported && !!sourceBufferValidAPI;

// Safari is still an exception since it has built-in HLS support; currently HLS.js
// is still in beta to support Safari
return !!isTypeSupported && !!sourceBufferValidAPI && !IS_SAFARI;
};

0 comments on commit 9df28f7

Please sign in to comment.