Skip to content

Commit

Permalink
fix: Check if change to the provided type is supported (#1463) (#1475)
Browse files Browse the repository at this point in the history
Co-authored-by: Radovan Tkac <tkac.radovan@gmail.com>
Co-authored-by: Radovan Tkac <radovan.tkac@zentity.com>
  • Loading branch information
3 people authored Jan 16, 2024
1 parent 8e8a341 commit e2ab570
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 @@ -281,8 +281,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 e2ab570

Please sign in to comment.