Skip to content

Commit f765e05

Browse files
authored
fix: Detect smooth codec switch support on Apple devices (#7678)
1 parent f992d9e commit f765e05

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
@@ -37,9 +37,10 @@ shaka.media.Capabilities = class {
3737
* @return {boolean}
3838
*/
3939
static isChangeTypeSupported() {
40-
return !!window.SourceBuffer &&
40+
const sourceBuffer = window.ManagedSourceBuffer || window.SourceBuffer;
41+
return !!sourceBuffer &&
4142
// eslint-disable-next-line no-restricted-syntax
42-
!!SourceBuffer.prototype && !!SourceBuffer.prototype.changeType;
43+
!!sourceBuffer.prototype && !!sourceBuffer.prototype.changeType;
4344
}
4445
};
4546

0 commit comments

Comments
 (0)