Skip to content

Commit

Permalink
Add DASH support
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Feb 27, 2025
1 parent 0d5980d commit 979bda7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2004,6 +2004,8 @@ shaka.dash.DashParser = class {
this.config_.ignoreDrmInfo,
this.config_.dash.keySystemsByURI);

context.adaptationSet.encrypted = contentProtection.drmInfos.length > 0;

const language = shaka.util.LanguageUtils.normalize(
context.adaptationSet.language || 'und');

Expand Down Expand Up @@ -2624,6 +2626,7 @@ shaka.dash.DashParser = class {
audioSamplingRate: null,
availabilityTimeOffset: 0,
segmentSequenceCadence: 0,
encrypted: false,
});
getBaseUris = getBaseUris || parent.getBaseUris;

Expand Down Expand Up @@ -2756,6 +2759,7 @@ shaka.dash.DashParser = class {
segmentSequenceCadence:
segmentSequenceCadence || parent.segmentSequenceCadence,
label: label || null,
encrypted: false,
};
}

Expand Down Expand Up @@ -3306,7 +3310,8 @@ shaka.dash.DashParser.RequestSegmentCallback;
* initialization: ?string,
* aesKey: (shaka.extern.aesKey|undefined),
* segmentSequenceCadence: number,
* label: ?string
* label: ?string,
* encrypted: boolean
* }}
*
* @description
Expand Down Expand Up @@ -3360,6 +3365,8 @@ shaka.dash.DashParser.RequestSegmentCallback;
* Representation.
* @property {?string} label
* Label or null if unknown.
* @property {boolean} encrypted
* Specifies is encrypted or not.
*/
shaka.dash.DashParser.InheritanceFrame;

Expand Down
4 changes: 3 additions & 1 deletion lib/dash/segment_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ shaka.dash.SegmentBase = class {

const getUris = () => resolvedUris;
const qualityInfo = shaka.dash.SegmentBase.createQualityInfo(context);
const encrypted = context.adaptationSet.encrypted;
const ref = new shaka.media.InitSegmentReference(
getUris,
startByte,
endByte,
qualityInfo,
/* timescale= */ null,
/* segmentData= */ null,
aesKey);
aesKey,
encrypted);
ref.codecs = context.representation.codecs;
ref.mimeType = context.representation.mimeType;
return ref;
Expand Down
4 changes: 3 additions & 1 deletion lib/dash/segment_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,16 @@ shaka.dash.SegmentTemplate = class {
return resolvedUris;
};
const qualityInfo = shaka.dash.SegmentBase.createQualityInfo(context);
const encrypted = context.adaptationSet.encrypted;
const ref = new shaka.media.InitSegmentReference(
getUris,
/* startByte= */ 0,
/* endByte= */ null,
qualityInfo,
/* timescale= */ null,
/* segmentData= */ null,
aesKey);
aesKey,
encrypted);
ref.codecs = context.representation.codecs;
ref.mimeType = context.representation.mimeType;
return ref;
Expand Down

0 comments on commit 979bda7

Please sign in to comment.