Skip to content

Commit

Permalink
fix(toDash): Generate unique Representation ids (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Mar 22, 2023
1 parent e7eacd9 commit a8b507e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils/FormatUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,15 @@ class FormatUtils {
const url = new URL(format.decipher(player));
url.searchParams.set('cpn', cpn || '');

let id;
if (format.audio_track) {
id = `${format.itag?.toString()}-${format.audio_track.id}`;
} else {
id = format.itag?.toString();
}

const representation = this.#el(document, 'Representation', {
id: format.itag?.toString(),
id,
codecs,
bandwidth: format.bitrate?.toString(),
audioSamplingRate: format.audio_sample_rate?.toString()
Expand Down

0 comments on commit a8b507e

Please sign in to comment.