Skip to content

Commit

Permalink
chore: Remove code duplication in shaka.media.Capabilities (#7676)
Browse files Browse the repository at this point in the history
  • Loading branch information
tykus160 authored and avelad committed Nov 27, 2024
1 parent 4bcc23e commit 24ad741
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/media/media_source_capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ shaka.media.Capabilities = class {
if (supportMap.has(type)) {
return supportMap.get(type);
}
if (window.ManagedMediaSource) {
const currentSupport = ManagedMediaSource.isTypeSupported(type);
supportMap.set(type, currentSupport);
return currentSupport;
} else if (window.MediaSource) {
const currentSupport = MediaSource.isTypeSupported(type);
const mediaSource = window.ManagedMediaSource || window.MediaSource;
if (mediaSource) {
const currentSupport = mediaSource.isTypeSupported(type);
supportMap.set(type, currentSupport);
return currentSupport;
}
Expand Down

0 comments on commit 24ad741

Please sign in to comment.