Skip to content

Commit

Permalink
Merge pull request #22 from DiceTechnology/feat/DORIS-1259-supported-…
Browse files Browse the repository at this point in the history
…codecs

fix: replace strings before support check
  • Loading branch information
grabofus authored Apr 25, 2022
2 parents 293482e + 1031d62 commit e5e7882
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashjs",
"version": "4.3.3",
"version": "4.3.4",
"description": "A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.",
"author": "Dash Industry Forum",
"license": "BSD-3-Clause",
Expand Down
17 changes: 8 additions & 9 deletions src/streaming/utils/CapabilitiesFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ function CapabilitiesFilter() {
const promises = [];
const configurations = [];

const { replaceCodecs } = settings.get().streaming.capabilities;

as.Representation_asArray.forEach((rep, i) => {
for (const [from, to] of replaceCodecs) {
if (rep.codecs?.toLowerCase() === from.toLowerCase()) {
rep.codecs = to;
}
}

const codec = adapter.getCodec(as, i, false);
const config = _createConfiguration(type,rep, codec);

Expand All @@ -128,15 +136,6 @@ function CapabilitiesFilter() {
Promise.all(promises)
.then((supported) => {
as.Representation_asArray = as.Representation_asArray
.map((representation) => {
const { replaceCodecs } = settings.get().streaming.capabilities;
for (const [from, to] of replaceCodecs) {
if (representation.codecs === from) {
representation.codecs = to;
}
}
return representation;
})
.filter((_, i) => {
if (!supported[i]) {
logger.debug(`[Stream] Codec ${configurations[i].codec} not supported `);
Expand Down

0 comments on commit e5e7882

Please sign in to comment.