Skip to content

Commit b711714

Browse files
committed
Error handling for PlayReady key with no status change
#7508
1 parent 4a334e9 commit b711714

File tree

9 files changed

+452
-300
lines changed

9 files changed

+452
-300
lines changed

src/controller/base-stream-controller.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ import {
2424
getAesModeFromFullSegmentMethod,
2525
isFullSegmentEncryption,
2626
} from '../utils/encryption-methods-util';
27-
import { getRetryDelay, offlineHttpStatus } from '../utils/error-helper';
27+
import {
28+
getRetryDelay,
29+
isUnusableKeyError,
30+
offlineHttpStatus,
31+
} from '../utils/error-helper';
2832
import {
2933
addEventListener,
3034
removeEventListener,
@@ -727,7 +731,9 @@ export default class BaseStreamController
727731
) {
728732
const media = this.media;
729733
const error = new Error(
730-
`Encrypted track with no key in ${this.fragInfo(frag)} (media ${media ? 'attached mediaKeys: ' + media.mediaKeys : 'detached'})`,
734+
__USE_EME_DRM__
735+
? `Encrypted track with no key in ${this.fragInfo(frag)} (media ${media ? 'attached mediaKeys: ' + media.mediaKeys : 'detached'})`
736+
: 'EME not supported (light build)',
731737
);
732738
this.warn(error.message);
733739
// Ignore if media is detached or mediaKeys are set
@@ -737,7 +743,7 @@ export default class BaseStreamController
737743
this.hls.trigger(Events.ERROR, {
738744
type: ErrorTypes.KEY_SYSTEM_ERROR,
739745
details: ErrorDetails.KEY_SYSTEM_NO_KEYS,
740-
fatal: false,
746+
fatal: !__USE_EME_DRM__,
741747
error,
742748
frag,
743749
});
@@ -1052,6 +1058,7 @@ export default class BaseStreamController
10521058
this.handleFragLoadAborted(data.frag, data.part);
10531059
} else if (data.frag && data.type === ErrorTypes.KEY_SYSTEM_ERROR) {
10541060
data.frag.abortRequests();
1061+
this.resetStartWhenNotLoaded();
10551062
this.resetFragmentLoading(data.frag);
10561063
} else {
10571064
this.hls.trigger(Events.ERROR, data as ErrorData);
@@ -1904,7 +1911,8 @@ export default class BaseStreamController
19041911
noAlternate &&
19051912
isMediaFragment(frag) &&
19061913
!frag.endList &&
1907-
live
1914+
live &&
1915+
!isUnusableKeyError(data)
19081916
) {
19091917
this.resetFragmentErrors(filterType);
19101918
this.treatAsGap(frag);

0 commit comments

Comments
 (0)