Skip to content

Commit

Permalink
make sure addSourceElement method exists
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-barstow committed Oct 9, 2024
1 parent d2e22ff commit 29b4302
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/videojs-http-streaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,12 @@ class VhsHandler extends Component {

// If we are playing HLS with MSE in Safari, add source elements for both the blob and manifest URLs.
// The latter will enable Airplay playback on receiver devices.
if ((videojs.browser.IS_ANY_SAFARI || videojs.browser.IS_IOS) && this.options_.overrideNative && this.options_.sourceType === 'hls') {
if ((
videojs.browser.IS_ANY_SAFARI || videojs.browser.IS_IOS) &&
this.options_.overrideNative &&
this.options_.sourceType === 'hls' &&
typeof this.tech_.addSourceElement === 'function'
) {
this.tech_.addSourceElement(this.mediaSourceUrl_);
this.tech_.addSourceElement(this.source_.src);
} else {
Expand Down

0 comments on commit 29b4302

Please sign in to comment.