Skip to content

feat: add tiktok support #1961

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

Merged
merged 2 commits into from
Jul 16, 2025
Merged

feat: add tiktok support #1961

merged 2 commits into from
Jul 16, 2025

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 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

@@ -12,6 +12,7 @@ export const MATCH_URL_WISTIA =
/(?: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
Preview

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.

description: false,
rel: false,
native_context_menu: true,
closed_caption: false,
}
Copy link
Preview

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
1 participant