Skip to content

Commit 8fa036a

Browse files
tykus160joeyparrish
authored andcommitted
fix: Detect smooth codec switch support on Apple devices (#7678)
1 parent 328dbbc commit 8fa036a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

externs/managedmediasource.js

+6
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ function ManagedMediaSource() {}
2222
* @return {boolean}
2323
*/
2424
ManagedMediaSource.isTypeSupported = function(type) {};
25+
26+
/**
27+
* @constructor
28+
* @extends {SourceBuffer}
29+
*/
30+
function ManagedSourceBuffer() {}

lib/media/media_source_capabilities.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ shaka.media.Capabilities = class {
4040
* @return {boolean}
4141
*/
4242
static isChangeTypeSupported() {
43-
return !!window.SourceBuffer &&
43+
const sourceBuffer = window.ManagedSourceBuffer || window.SourceBuffer;
44+
return !!sourceBuffer &&
4445
// eslint-disable-next-line no-restricted-syntax
45-
!!SourceBuffer.prototype && !!SourceBuffer.prototype.changeType;
46+
!!sourceBuffer.prototype && !!sourceBuffer.prototype.changeType;
4647
}
4748
};
4849

0 commit comments

Comments
 (0)