Skip to content

Commit

Permalink
fix(media-composition): remove audio chapters
Browse files Browse the repository at this point in the history
Fixes #245 by removing audio chapters from `mediaComposition`. The reason for
this is that audio chaptering is physical, not logical. This results in data
inconsistency and prevents chapter change events from being sent.

- delete audio chapters from audio URNs or audio chapters from video URNs

Ref: SRGSSR/pillarbox-apple#842
  • Loading branch information
amtins committed Apr 24, 2024
1 parent f7412b1 commit 48e3c6d
Show file tree
Hide file tree
Showing 4 changed files with 2,020 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/dataProvider/model/MediaComposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ class MediaComposition {
* @returns {Array.<Chapter>} of chapters
*/
getChapters() {
return this.chapterList;
const AUDIO = 'AUDIO';

if (this.getMainChapter().mediaType === AUDIO) return [];

return this.chapterList.filter(({ mediaType }) => mediaType !== AUDIO);
}

/**
Expand Down
Loading

0 comments on commit 48e3c6d

Please sign in to comment.