Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle time intervals #212

Closed
amtins opened this issue Feb 19, 2024 · 2 comments · Fixed by #207
Closed

Handle time intervals #212

amtins opened this issue Feb 19, 2024 · 2 comments · Fixed by #207
Labels
enhancement New feature or request released on @main

Comments

@amtins
Copy link
Member

amtins commented Feb 19, 2024

As a developer, I'd like to be able to create my own UI/UX for time intervals, e.g skip credits

Acceptance Criteria

  • The player provides access to the time intervals
@amtins amtins added the enhancement New feature or request label Feb 19, 2024
@amtins amtins added this to Pillarbox Feb 19, 2024
@github-project-automation github-project-automation bot moved this to ✏️ Draft in Pillarbox Feb 19, 2024
@amtins amtins moved this from ✏️ Draft to 📋 Backlog in Pillarbox Feb 19, 2024
@amtins amtins added this to the Custom text tracks milestone Feb 19, 2024
@defagos
Copy link
Member

defagos commented Feb 19, 2024

On Apple platforms TimeInterval is a type (a double, basically). Maybe we could cal this concept simply Interval if we want to have the same name on all platforms?

amtins added a commit that referenced this issue Feb 20, 2024
Resolves #212 by giving developers access to intervals directly from the
player's text tracks.

Intervals, as defined by SRG SSR, can be used, for example, to define the
position of the opening and closing credits of a media.

Intervals can be accessed in several ways. The first is raw data via the
mediaData object from player currentSource. The second is via the player's
textTracks. This latter method allows you to listen to the cuechange event and
react as required.

```javascript
// Accessing raw data
player.currentSource().mediaData.intervals;

// Listen for cuechange events and get the active cue
player.textTracks().getTrackById('srgssr-intervals').on('cuechange', ()=>{
	const [active] = Array.from(player.textTracks().getTrackById('srgssr-intervals').activeCues);
  JSON.parse(active); // note that active can be undefined
});
```

- adds the intervals property to the mediaComposition
- adds a function for adding intervals to the player
- adds intervals when resolving the resource in the setSource function
- add test cases
- add a test media containing an interval
@amtins amtins moved this from 📋 Backlog to 🚧 In Progress in Pillarbox Feb 21, 2024
amtins added a commit that referenced this issue Feb 23, 2024
Resolves #212 by giving developers access to intervals directly from the
player's text tracks.

Intervals, as defined by SRG SSR, can be used, for example, to define the
position of the opening and closing credits of a media.

Intervals can be accessed in several ways. The first is raw data via the
mediaData object from player currentSource. The second is via the player's
textTracks. This latter method allows you to listen to the cuechange event and
react as required.

```javascript
// Accessing raw data
player.currentSource().mediaData.intervals;

// Listen for cuechange events and get the active cue
player.textTracks().getTrackById('srgssr-intervals').on('cuechange', ()=>{
	const [active] = Array.from(player.textTracks().getTrackById('srgssr-intervals').activeCues);
  JSON.parse(active); // note that active can be undefined
});
```

- adds the intervals property to the mediaComposition
- adds a function for adding intervals to the player
- adds intervals when resolving the resource in the setSource function
- add test cases
- add a test media containing an interval
@amtins amtins moved this from 🚧 In Progress to 🍿 Code Review in Pillarbox Feb 23, 2024
amtins added a commit that referenced this issue Feb 23, 2024
Resolves #212 by giving developers access to intervals directly from the
player's text tracks.

Intervals, as defined by SRG SSR, can be used, for example, to define the
position of the opening and closing credits of a media.

Intervals can be accessed in several ways. The first is raw data via the
mediaData object from player currentSource. The second is via the player's
textTracks. This latter method allows you to listen to the cuechange event and
react as required.

```javascript
// Accessing raw data
player.currentSource().mediaData.intervals;

// Listen for cuechange events and get the active cue
player.textTracks().getTrackById('srgssr-intervals').on('cuechange', ()=>{
	const [active] = Array.from(player.textTracks().getTrackById('srgssr-intervals').activeCues);
  JSON.parse(active.text); // note that active can be undefined
});
```

- adds the intervals property to the mediaComposition
- adds a function for adding intervals to the player
- adds intervals when resolving the resource in the setSource function
- add test cases
- add a test media containing an interval
amtins added a commit that referenced this issue Feb 23, 2024
Resolves #212 by giving developers access to intervals directly from the
player's text tracks.

Intervals, as defined by SRG SSR, can be used, for example, to define the
position of the opening and closing credits of a media.

Intervals can be accessed in several ways. The first is raw data via the
mediaData object from player currentSource. The second is via the player's
textTracks. This latter method allows you to listen to the cuechange event and
react as required.

```javascript
// Accessing raw data
player.currentSource().mediaData.intervals;

// Listen for cuechange events and get the active cue
player.textTracks().getTrackById('srgssr-intervals').on('cuechange', ()=>{
	const [active] = Array.from(player.textTracks().getTrackById('srgssr-intervals').activeCues);
  JSON.parse(active.text); // note that active can be undefined
});
```

- adds the intervals property to the mediaComposition
- adds a function for adding intervals to the player
- adds intervals when resolving the resource in the setSource function
- add test cases
- add a test media containing an interval
@github-project-automation github-project-automation bot moved this from 🍿 Code Review to ✅ Done in Pillarbox Feb 23, 2024
github-actions bot pushed a commit that referenced this issue Feb 23, 2024
## [1.1.0](v1.0.1...v1.1.0) (2024-02-23)

### Refactor 🔩

* **srgssr-middleware:** move srgssr specific options declaration ([1138f89](1138f89))
* **srgssrg-middleware:** extraction of duplicated code in text tracks ([4ff0bc8](4ff0bc8))

### New Features 🚀

* **mediaComposition:** exposes the media URN through the main resources ([4b4c5a5](4b4c5a5))
* **srgssr-middleware:** add blocked segments support ([ad4e906](ad4e906)), closes [#211](#211)
* **srgssr-middleware:** add chapters support ([62ff02a](62ff02a)), closes [#204](#204)
* **srgssr-middleware:** add intervals support ([00ad42c](00ad42c)), closes [#212](#212)
* **srgssr-middleware:** add support for remote subtitles ([dbe9eb4](dbe9eb4)), closes [#203](#203)

### CI 🔁

* add pull request previews ([a50f20d](a50f20d)), closes [#196](#196)

### Docs 📖

* **analytics:** add tracking limitations section to known issues ([a69c916](a69c916)), closes [#208](#208)
Copy link

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released on @main
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants