Skip to content

Commit

Permalink
Merge pull request #1498 from canalplus/fix/firefox-workaround-v2
Browse files Browse the repository at this point in the history
DRM: Don't work-around firefox issue if the application asked for specific capabilities
  • Loading branch information
peaBerberian authored Aug 13, 2024
2 parents e90c43a + 6bf41cd commit 3f8b756
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/main_thread/decrypt/find_key_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,31 @@ function buildKeySystemConfigurations(
sessionTypes,
};

if (audioCapabilitiesConfig !== undefined) {
if (videoCapabilitiesConfig !== undefined) {
return [wantedMediaKeySystemConfiguration];
}
return [
wantedMediaKeySystemConfiguration,
{
...wantedMediaKeySystemConfiguration,
// Re-try without `videoCapabilities` in case the EME implementation is
// buggy
videoCapabilities: undefined,
} as unknown as MediaKeySystemConfiguration,
];
} else if (videoCapabilitiesConfig !== undefined) {
return [
wantedMediaKeySystemConfiguration,
{
...wantedMediaKeySystemConfiguration,
// Re-try without `audioCapabilities` in case the EME implementation is
// buggy
audioCapabilities: undefined,
} as unknown as MediaKeySystemConfiguration,
];
}

return [
wantedMediaKeySystemConfiguration,

Expand Down

0 comments on commit 3f8b756

Please sign in to comment.