Skip to content

Commit

Permalink
fix: Check if change to the provided type is supported (#1463)
Browse files Browse the repository at this point in the history
Co-authored-by: Radovan Tkac <radovan.tkac@zentity.com>
  • Loading branch information
rtkac and Radovan Tkac authored Jan 16, 2024
1 parent 27d1108 commit 8cf0c5f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/source-updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,13 @@ const actions = {

sourceUpdater.logger_(`changing ${type}Buffer codec from ${sourceUpdater.codecs[type]} to ${codec}`);

sourceBuffer.changeType(mime);
sourceUpdater.codecs[type] = codec;
// check if change to the provided type is supported
try {
sourceBuffer.changeType(mime);
sourceUpdater.codecs[type] = codec;
} catch (e) {
videojs.log.warn(`Failed to changeType on ${type}Buffer`, e);
}
}
};

Expand Down

0 comments on commit 8cf0c5f

Please sign in to comment.