Skip to content

Conversation

@luwes
Copy link
Collaborator

@luwes luwes commented Jul 11, 2025

No description provided.

@luwes luwes requested a review from Copilot July 11, 2025 01:17
@luwes luwes self-assigned this Jul 11, 2025
@luwes luwes temporarily deployed to github-preview July 11, 2025 01:17 — with GitHub Actions Inactive
@luwes luwes merged commit c69e9ce into master Jul 11, 2025
12 checks passed
@luwes luwes deleted the add-players branch July 11, 2025 01:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds first-class Spotify and Twitch media support by extending types, player registrations, URL matching, and examples.

  • Defines new config types for Spotify and Twitch in the shared Config interface.
  • Registers Spotify and Twitch players in the Players array and adds URL patterns/canPlay logic.
  • Includes new dependencies and example usage in the React demo app.

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types.ts Imported Spotify/Twitch element types and added config entries.
src/players.ts Added Spotify and Twitch entries to the player registry.
src/patterns.ts Introduced MATCH_URL_SPOTIFY/TWITCH regexes and canPlay checks.
package.json Added spotify-audio-element and twitch-video-element deps.
examples/react/src/App.tsx Updated previewConfig and added Spotify/Twitch buttons.
Comments suppressed due to low confidence (2)

src/patterns.ts:41

  • There are no unit tests covering the new canPlay.spotify logic. Adding tests for valid and invalid Spotify URLs will ensure correct matching behavior.
  spotify: (url: string) => MATCH_URL_SPOTIFY.test(url),

src/patterns.ts:42

  • There are no unit tests covering the new canPlay.twitch logic. Adding tests for valid and invalid Twitch URLs will ensure correct matching behavior.
  twitch: (url: string) => MATCH_URL_TWITCH.test(url),

export const MATCH_URL_VIMEO = /vimeo\.com\/(?!progressive_redirect).+/;
export const MATCH_URL_WISTIA =
/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/;
export const MATCH_URL_SPOTIFY = /open\.spotify\.com\/(\w+)\/(\w+)/i;
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider anchoring the Spotify URL regex (e.g. using end-of-string or query parameter anchors) to align with other MATCH_URL patterns and prevent unintended partial matches.

Suggested change
export const MATCH_URL_SPOTIFY = /open\.spotify\.com\/(\w+)\/(\w+)/i;
export const MATCH_URL_SPOTIFY = /open\.spotify\.com\/(\w+)\/(\w+)($|\?)/i;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants