Skip to content

Commit

Permalink
fix: Detect smooth codec switch support on Apple devices (#7678)
Browse files Browse the repository at this point in the history
  • Loading branch information
tykus160 authored Nov 27, 2024
1 parent f992d9e commit f765e05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions externs/managedmediasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ function ManagedMediaSource() {}
* @return {boolean}
*/
ManagedMediaSource.isTypeSupported = function(type) {};

/**
* @constructor
* @extends {SourceBuffer}
*/
function ManagedSourceBuffer() {}
5 changes: 3 additions & 2 deletions lib/media/media_source_capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ shaka.media.Capabilities = class {
* @return {boolean}
*/
static isChangeTypeSupported() {
return !!window.SourceBuffer &&
const sourceBuffer = window.ManagedSourceBuffer || window.SourceBuffer;
return !!sourceBuffer &&
// eslint-disable-next-line no-restricted-syntax
!!SourceBuffer.prototype && !!SourceBuffer.prototype.changeType;
!!sourceBuffer.prototype && !!sourceBuffer.prototype.changeType;
}
};

Expand Down

0 comments on commit f765e05

Please sign in to comment.