SRGSSR / pillarbox-web

Pillarbox is a versatile media playback ecosystem engineered for the web.
https://srgssr.github.io/pillarbox-web-demo/
MIT License
12 stars 1 forks source link

feat(srgssr-middleware): add custom text tracks cuechange event proxy #224

Closed amtins closed 6 months ago

amtins commented 6 months ago

Description

This new feature allows to listen to events linked to chapters, intervals and blocked segments directly from the player. This eliminates the need to check that text tracks are loaded correctly, in order to avoid errors.

These events will contain a data property whose value will be the VTTCue when entering the cue or undefined when leaving it. This is valid for chapters and intervals, however the exit of a blocked segment is not notified, since it occurs instantaneously.

Added events:

Usage:

// Listen to an event
player.on('srgssr/blocked-segment', ({ type, data }) => {
  // do something
});
// Listen to multiple events at the same time
player.on([
  'srgssr/blocked-segment',
  'srgssr/chapter',
  'srgssr/interval'
  ], ({ type, data }) => {
  // do something
});

Changes made

github-actions[bot] commented 6 months ago

PR Preview Action v1.4.7 :---: Preview removed because the pull request was closed. 2024-03-14 15:52 UTC

github-actions[bot] commented 6 months ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟢 Statements
98.8% (+0.02% 🔼)
578/585
🟢 Branches
95.67% (+0.12% 🔼)
287/300
🟢 Functions
99.4% (+0.01% 🔼)
165/166
🟢 Lines
99.28% (+0.01% 🔼)
549/553

Test suite run success

190 tests passing in 9 suites.

Report generated by 🧪jest coverage report action from c246a926de155c8dae46214f57bd52d1fab7ad6d

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 1.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: