Skip to content

Conversation

@luwes
Copy link
Collaborator

@luwes luwes commented Jul 16, 2025

fix #1193

@luwes luwes requested a review from Copilot July 16, 2025 14:41
@luwes luwes self-assigned this Jul 16, 2025
@luwes luwes temporarily deployed to github-preview July 16, 2025 14:41 — with GitHub Actions Inactive
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

This PR adds TikTok video support to the media player library, allowing users to play TikTok videos alongside existing platforms like YouTube, Vimeo, and Twitch.

  • Adds TikTok video element integration with configuration options
  • Implements URL pattern matching for TikTok video URLs
  • Adds TikTok player to the available players list with lazy loading support

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types.ts Adds TikTok type import and configuration interface
src/players.ts Registers TikTok player with lazy loading and PIP disabled
src/patterns.ts Implements TikTok URL pattern matching regex
package.json Adds tiktok-video-element dependency
examples/react/src/App.tsx Adds TikTok configuration options and test URLs

/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/;
export const MATCH_URL_SPOTIFY = /open\.spotify\.com\/(\w+)\/(\w+)/i;
export const MATCH_URL_TWITCH = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/;
export const MATCH_URL_TIKTOK = /tiktok\.com\/(?:@[^/]+\/video\/)?(\d+)(?:\/([\w-]+))?/;
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

The TikTok URL regex pattern may not handle all TikTok URL variations. Consider adding support for mobile URLs (m.tiktok.com) and ensuring the pattern matches the actual URL structure used in the test cases.

Suggested change
export const MATCH_URL_TIKTOK = /tiktok\.com\/(?:@[^/]+\/video\/)?(\d+)(?:\/([\w-]+))?/;
export const MATCH_URL_TIKTOK = /(?:www\.|m\.)?tiktok\.com\/(?:@[^/]+\/video\/|v\/)?(\d+)(?:\/([\w-]+))?/;

Copilot uses AI. Check for mistakes.
rel: false,
native_context_menu: true,
closed_caption: false,
}
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

Missing comma after the spotify configuration object, which will cause a syntax error when the tiktok configuration is added.

Copilot uses AI. Check for mistakes.
@luwes luwes temporarily deployed to github-preview July 16, 2025 14:42 — with GitHub Actions Inactive
@luwes luwes temporarily deployed to github-preview July 16, 2025 14:42 — with GitHub Actions Inactive
@luwes luwes merged commit d721889 into master Jul 16, 2025
12 checks passed
@luwes luwes deleted the tiktok branch July 16, 2025 14:43
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.

Tik Tok Support

2 participants