Skip to content

Commit

Permalink
Add DRM-related logs and remove unused variant
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Sep 19, 2024
1 parent 8c5e936 commit 8b7ff01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/main_thread/decrypt/content_decryptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export default class ContentDecryptor extends EventEmitter<IContentDecryptorEven

this.systemId = systemId;
if (this._stateData.state === ContentDecryptorState.Initializing) {
log.debug("DRM: Waiting for attachment.");
this._stateData = {
state: ContentDecryptorState.WaitingForAttachment,
isInitDataQueueLocked: true,
Expand Down Expand Up @@ -260,6 +261,7 @@ export default class ContentDecryptor extends EventEmitter<IContentDecryptorEven
const shouldDisableLock = options.disableMediaKeysAttachmentLock === true;

if (shouldDisableLock) {
log.debug("DRM: disabling MediaKeys attachment lock. Ready for content");
this._stateData = {
state: ContentDecryptorState.ReadyForContent,
isInitDataQueueLocked: true,
Expand Down
1 change: 1 addition & 0 deletions src/main_thread/decrypt/get_media_keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default async function getMediaKeysInfos(
currentState !== null &&
evt.type === "reuse-media-key-system-access"
) {
log.debug("DRM: Reusing already created MediaKeys");
const { mediaKeys, loadedSessionsStore } = currentState;

// We might just rely on the currently attached MediaKeys instance.
Expand Down
18 changes: 0 additions & 18 deletions src/main_thread/init/multi_thread_content_initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2006,24 +2006,6 @@ type IDecryptionInitializationState =
* `HTMLMediaElement` (such as linking a content / `MediaSource` to it).
*/
| { type: "uninitialized"; value: null }
/**
* The `MediaSource` or media url has to be linked to the `HTMLMediaElement`
* before continuing.
* Once it has been linked with success (e.g. the `MediaSource` has "opened"),
* the `isMediaLinked` `SharedReference` should be set to `true`.
*
* In the `MediaSource` case, you should wait until the `"initialized"`
* state before pushing segment.
*
* Note that the `"awaiting-media-link"` is an optional state. It can be
* skipped to directly `"initialized"` instead.
*/
| {
type: "awaiting-media-link";
value: {
isMediaLinked: SharedReference<boolean>;
};
}
/**
* The `MediaSource` or media url can be linked AND segments can be pushed to
* the `HTMLMediaElement` on which decryption capabilities were wanted.
Expand Down

0 comments on commit 8b7ff01

Please sign in to comment.