-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add tiktok support #1961
Conversation
There was a problem hiding this 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-]+))?/; |
There was a problem hiding this comment.
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.
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, | ||
} |
There was a problem hiding this comment.
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.
fix #1193