Skip to content

Commit

Permalink
chore: update v7.0.0 documentation (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
wseymour15 committed Jul 24, 2023
1 parent 1322105 commit 21e55aa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@
* update collaborator guide md ([51b3ed4](https://github.com/videojs/mux.js/commit/51b3ed4))
* update git push suggestion in collaborator guide md ([73a5b60](https://github.com/videojs/mux.js/commit/73a5b60))

### BREAKING CHANGES

* In the case of CEA-608 captions, mux.js will now be returning captions in the form of caption sets.
This means that rather then returning a single text of combined caption cues, an array of caption cues is returned in the `content` property.

```js
transmuxer.on('data', function (segment) {
// create a VTTCue for all the parsed CEA-608 captions:>
segment.captions.forEach(function(captionSet) {
// Caption sets contains multiple captions with text and position data.
captionSet.content.forEach(function(cue) {
const newCue = new VTTCue(cue.startTime, cue.endTime, cue.text);
newCue.line = cue.line;
newCue.position = cue.position;

captionTextTrack.addCue(newCue);
});
});
});
```

<a name="6.3.0"></a>
# [6.3.0](https://github.com/videojs/mux.js/compare/v6.2.0...v6.3.0) (2023-02-22)

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,15 @@ transmuxer.on('data', function (segment) {
metadataTextTrack.addCue(new VTTCue(time, time, frame.value));
});
// create a VTTCue for all the parsed CEA-608 captions:>
segment.captions.forEach(function(cue) {
captionTextTrack.addCue(new VTTCue(cue.startTime, cue.endTime, cue.text));
segment.captions.forEach(function(captionSet) {
// Caption sets contains multiple caption cues with text and position data.
captionSet.content.forEach(function(cue) {
const newCue = new VTTCue(cue.startTime, cue.endTime, cue.text);
newCue.line = cue.line;
newCue.position = cue.position;

captionTextTrack.addCue(newCue);
});
});
});
```
Expand Down

0 comments on commit 21e55aa

Please sign in to comment.