Conversation
There was a problem hiding this comment.
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-]+))?/; |
There was a problem hiding this comment.
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-]+))?/; |
| rel: false, | ||
| native_context_menu: true, | ||
| closed_caption: false, | ||
| } |
There was a problem hiding this comment.
Missing comma after the spotify configuration object, which will cause a syntax error when the tiktok configuration is added.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #1193