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

feat: add skip button plugin #2

Merged
merged 6 commits into from
Apr 30, 2024
Merged

feat: add skip button plugin #2

merged 6 commits into from
Apr 30, 2024

Conversation

jboix
Copy link
Contributor

@jboix jboix commented Apr 25, 2024

Description

Introduces the skip button plugin, providing a convenient option to skip segments of a video. Key features include:

  • Detection of skippable segments, such as opening intros and closing credits, through the srgssr/interval event from the Pillarbox player.
  • Multilingual support with translations in French, Italian, English, German, and Romansh.

Example of integration

import Pillarbox from '@srgssr/pillarbox-web';
import '@srgssr/skip-button-plugin';

const player = new Pillarbox('my-player', { plugins: { 'skip-button-plugin': true } });
player.src({
  src: 'urn:swi:video:48115940',
  type: 'srgssr/urn'
});

Screenshot

image

Changes Made

  • Migrated test framework from jest to vitest:
    • Adjusted plugin template with a default vitest configuration.
    • Adjusted eslint configuration with vitest plugins.
  • Added a new prompt in the create script asking for localisation, this prompt will automatically generate the folder structure and the bindings if the users wishes to include localisation to their plugin.
  • Added a new prompt in the create script to enable users to specify whether they want to generate a new component, plugin, or button.

Checklist

  • I have followed the project's style and contribution guidelines.
  • I have performed a self-review of my own changes.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.

@jboix jboix requested a review from amtins April 25, 2024 08:45
@jboix jboix self-assigned this Apr 25, 2024
@jboix jboix force-pushed the feat/skip-button-plugin branch from a035ba6 to 3739222 Compare April 25, 2024 09:05
@SRGSSR SRGSSR deleted a comment from github-actions bot Apr 25, 2024
Copy link

github-actions bot commented Apr 25, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 100% 93 / 93
🔵 Statements 100% 93 / 93
🔵 Functions 85.71% 6 / 7
🔵 Branches 88.88% 8 / 9
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
plugins/skip-button/src/skip-button.js 100% 88.88% 85.71% 100%
plugins/skip-button/src/lang/index.js 100% 100% 100% 100%
Generated in workflow #17

jboix added 2 commits April 25, 2024 13:43
Introduces the skip button plugin, providing a convenient option to skip segments of a video. Key
features include:

- Detection of skippable segments, such as opening intros and closing credits, through
  the `srgssr/interval` event from the Pillarbox player.
- Multilingual support with translations in French, Italian, English, German, and Romansh.

Example of integration:

```javascript
import Pillarbox from '@srgssr/pillarbox-web';
import '@srgssr/skip-button-plugin';

const player = new Pillarbox('my-player', { plugins: { 'skip-button-plugin': true } });
player.src({
  src: 'urn:swi:video:48115940',
  type: 'srgssr/urn'
});
```
Introduces vitest as a testing framework. Vitest integrates with es modules by default
resulting in a better integration.

Changes made:
- Adjusted plugin template with a default vitest configuration.
- Adjustes eslint configuration with vitest plugins.
@jboix jboix force-pushed the feat/skip-button-plugin branch from 3739222 to 3ffcba1 Compare April 25, 2024 11:43
Copy link

github-actions bot commented Apr 25, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-04-30 09:38 UTC

@jboix jboix changed the title Feat/skip button plugin feat: add skip button plugin Apr 25, 2024
jboix added 2 commits April 26, 2024 20:55
- Ensures that the skip button component functions correctly in isolation.
- Moved class building to `buildCssClass` function.
- Adjusted style and removed unused inline in `skip-button-plugin.js` file.
- Fixed the plugin configuration example in the README.
- Fixed the plugin configuration example in the README template.
- Adds dedicated `json` files for each localization.
- A new prompt has been added to the `create:plugin` script asking for localization,
  this prompt will automatically generate the folder structure and the bindings if the
  users wishes to include localization to their plugin.
@jboix jboix force-pushed the feat/skip-button-plugin branch from 3ffcba1 to 0f3b89b Compare April 26, 2024 19:17
Adds dispose logic to remove the event listener from the player.
@jboix jboix force-pushed the feat/skip-button-plugin branch 3 times, most recently from e1519be to ad46fd3 Compare April 29, 2024 14:48
@jboix jboix force-pushed the feat/skip-button-plugin branch 2 times, most recently from 6c47660 to ed26264 Compare April 30, 2024 08:31
- Added a new prompt in the `create` script to enable users to specify whether they want to generate
  a new component, plugin, or button.
- Adapted the existing templates to correctly produce the type of element selected by the user.
- Migrated the functionality of the skip-button-plugin into a simpler component format.
@jboix jboix force-pushed the feat/skip-button-plugin branch from ed26264 to c5b87c7 Compare April 30, 2024 09:34
@jboix jboix requested a review from amtins April 30, 2024 09:36
Copy link
Member

@amtins amtins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@jboix jboix added this pull request to the merge queue Apr 30, 2024
Merged via the queue into main with commit 0372af9 Apr 30, 2024
4 checks passed
@jboix jboix deleted the feat/skip-button-plugin branch April 30, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants