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 playlist management plugin to pillarbox player #6

Merged
merged 1 commit into from
May 14, 2024

Conversation

jboix
Copy link
Contributor

@jboix jboix commented May 7, 2024

Description

Introduces a pillarbox playlist plugin. This plugin supports playlist loading, dynamic modifications, auto-advancement, and repeat functionalities.

Key Features

  • Initialization Options: Configurable through an options object that can include an initial playlist, and settings for repeat and auto-advance behaviors.
  • Dynamic Playlist Management: Methods to load, push, splice, and shuffle playlist items dynamically.
  • Playback Control: Functions to navigate through the playlist such as next, previous, and select specific items.
  • State Properties: Properties like repeat and autoadvance which can be toggled post-initialization to alter playback behavior.

Example

import Pillarbox from '@srgssr/pillarbox-web';
import '@srgssr/pillarbox-playlist';

const player = new Pillarbox('my-player', {
  plugins: { pillarboxPlaylist: { autoadvance: true, repeat: true } }
});

const playlist = [
  { sources: [{ src: 'video1.mp4', type: 'video/mp4' }], poster: 'poster1.jpg' },
  { sources: [{ src: 'video2.mp4', type: 'video/mp4' }], poster: 'poster2.jpg' }
];

player.pillarboxPlaylist().load(playlist);

Other Changes

  • Disabled tracking for all demo pages.

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 self-assigned this May 7, 2024
Copy link

github-actions bot commented May 7, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 97.64% 373 / 382
🔵 Statements 97.64% 373 / 382
🔵 Functions 91.66% 22 / 24
🔵 Branches 85% 34 / 40
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/pillarbox-playlist/src/pillarbox-playlist.js 96.88% 83.87% 94.11% 96.88% 61-64, 124-125, 267, 269-270
Generated in workflow #32

Copy link

github-actions bot commented May 7, 2024

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

@jboix jboix requested a review from amtins May 7, 2024 16:01
@jboix jboix marked this pull request as ready for review May 7, 2024 16:01
@jboix jboix force-pushed the feat/playlist-plugin branch 2 times, most recently from cd3af51 to 4087855 Compare May 10, 2024 13:39
Introduces a pillarbox playlist plugin. This plugin supports playlist loading, dynamic
modifications, auto-advancement, and repeat functionalities.

***Key Features:***

- **Initialization Options**: Configurable through an options object that can include an initial
  playlist, and settings for repeat and auto-advance behaviors.
- **Dynamic Playlist Management**: Methods to load, push, splice, and shuffle playlist items
  dynamically.
- **Playback Control**: Functions to navigate through the playlist such as next, previous, and
  select specific items.
- **State Properties**: Properties like `repeat` and `autoadvance` which can be toggled
  post-initialization to alter playback behavior.

***Example***

```javascript
import Pillarbox from '@srgssr/pillarbox-web';
import '@srgssr/pillarbox-playlist';

const player = new Pillarbox('my-player', {
  plugins: { pillarboxPlaylist: { autoadvance: true, repeat: true } }
});

const playlist = [
  { sources: [{ src: 'video1.mp4', type: 'video/mp4' }], poster: 'poster1.jpg' },
  { sources: [{ src: 'video2.mp4', type: 'video/mp4' }], poster: 'poster2.jpg' }
];

player.pillarboxPlaylist().load(playlist);
```
@jboix jboix force-pushed the feat/playlist-plugin branch from 4087855 to 840da53 Compare May 14, 2024 15:02
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.

LGTM! 🚀

@jboix jboix added this pull request to the merge queue May 14, 2024
Merged via the queue into main with commit 54520dc May 14, 2024
4 checks passed
@jboix jboix deleted the feat/playlist-plugin branch May 14, 2024 15:30
Copy link

🎉 This PR is included in version @srgssr/pillarbox-playlist-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @srgssr/skip-button-v1.0.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
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants