Skip to content

Commit

Permalink
Add logs for all reasons for which a Representation can be filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Feb 9, 2023
1 parent 2e42c11 commit 4101cde
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/decrypt/utils/check_key_statuses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function checkKeyStatuses(
const keyStatusObj = { keyId: keyId.buffer, keyStatus };

if (log.hasLevel("DEBUG")) {
log.debug(`DRM: key status update (${bytesToHex(keyId)}:`, keyStatus);
log.debug(`DRM: key status update (${bytesToHex(keyId)}): ${keyStatus}`);
}

switch (keyStatus) {
Expand Down
7 changes: 7 additions & 0 deletions src/manifest/adaptation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import log from "../log";
import { IParsedAdaptation } from "../parsers/manifest";
import { IRepresentationFilter } from "../public_types";
import arrayFind from "../utils/array_find";
Expand Down Expand Up @@ -164,6 +165,12 @@ export default class Adaptation {
if (!isSupported && representation.isSupported) {
isSupported = true;
}
} else {
log.debug("Filtering Representation due to representationFilter",
this.type,
`Adaptation: ${this.id}`,
`Representation: ${representation.id}`,
`(${representation.bitrate})`);
}
}
representations.sort((a, b) => a.bitrate - b.bitrate);
Expand Down
4 changes: 4 additions & 0 deletions src/manifest/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import { MediaError } from "../errors";
import log from "../log";
import { IParsedManifest } from "../parsers/manifest";
import {
IPlayerError,
Expand Down Expand Up @@ -786,6 +787,9 @@ function updateDeciperability(
const result = isDecipherable(representation);
if (result !== representation.decipherable) {
updates.push({ manifest, period, adaptation, representation });
log.debug(`Decipherability changed for "${representation.id}"`,
`(${representation.bitrate})`,
String(representation.decipherable));
representation.decipherable = result;
}
}
Expand Down
14 changes: 10 additions & 4 deletions src/manifest/representation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,16 @@ class Representation {
this.cdnMetadata = args.cdnMetadata;

this.index = args.index;
this.isSupported = opts.type === "audio" ||
opts.type === "video" ?
isCodecSupported(this.getMimeTypeString()) :
true; // TODO for other types
if (opts.type === "audio" || opts.type === "video") {
const mimeTypeStr = this.getMimeTypeString();
const isSupported = isCodecSupported(mimeTypeStr);
if (!isSupported) {
log.info("Unsupported Representation", mimeTypeStr, this.id, this.bitrate);
}
this.isSupported = isSupported;
} else {
this.isSupported = true; // TODO for other types
}
}

/**
Expand Down

0 comments on commit 4101cde

Please sign in to comment.