Skip to content

Commit

Permalink
fix: Fix MCap checking when using src= (shaka-project#6675)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed May 28, 2024
1 parent 35cd411 commit 54234f1
Showing 1 changed file with 38 additions and 31 deletions.
69 changes: 38 additions & 31 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2615,42 +2615,49 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
disabledUntilTime: 0,
primary: false,
audio: null,
video: {
id: 0,
originalId: null,
groupId: null,
createSegmentIndex: () => Promise.resolve(),
segmentIndex: null,
mimeType: mimeType ? shaka.util.MimeUtils.getBasicType(mimeType) : '',
codecs: mimeType ? shaka.util.MimeUtils.getCodecs(mimeType) : '',
encrypted: true,
drmInfos: [], // Filled in by DrmEngine config.
keyIds: new Set(),
language: 'und',
originalLanguage: null,
label: null,
type: ContentType.VIDEO,
primary: false,
trickModeVideo: null,
emsgSchemeIdUris: null,
roles: [],
forced: false,
channelsCount: null,
audioSamplingRate: null,
spatialAudio: false,
closedCaptions: null,
accessibilityPurpose: null,
external: false,
fastSwitching: false,
fullMimeTypes: new Set(),
},
video: null,
bandwidth: 100,
allowedByApplication: true,
allowedByKeySystem: true,
decodingInfos: [],
};
variant.video.fullMimeTypes.add(shaka.util.MimeUtils.getFullType(
variant.video.mimeType, variant.video.codecs));
const stream = {
id: 0,
originalId: null,
groupId: null,
createSegmentIndex: () => Promise.resolve(),
segmentIndex: null,
mimeType: mimeType ? shaka.util.MimeUtils.getBasicType(mimeType) : '',
codecs: mimeType ? shaka.util.MimeUtils.getCodecs(mimeType) : '',
encrypted: true,
drmInfos: [], // Filled in by DrmEngine config.
keyIds: new Set(),
language: 'und',
originalLanguage: null,
label: null,
type: ContentType.VIDEO,
primary: false,
trickModeVideo: null,
emsgSchemeIdUris: null,
roles: [],
forced: false,
channelsCount: null,
audioSamplingRate: null,
spatialAudio: false,
closedCaptions: null,
accessibilityPurpose: null,
external: false,
fastSwitching: false,
fullMimeTypes: new Set(),
};
stream.fullMimeTypes.add(shaka.util.MimeUtils.getFullType(
stream.mimeType, stream.codecs));
if (mimeType.startsWith('audio/')) {
stream.type = ContentType.AUDIO;
variant.audio = stream;
} else {
variant.video = stream;
}

this.drmEngine_.setSrcEquals(/* srcEquals= */ true);
await this.drmEngine_.initForPlayback(
Expand Down

0 comments on commit 54234f1

Please sign in to comment.