-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add support for multiple concurrent players #30
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
Conversation
- Enable simultaneous usage of multiple player instances - Implement independent instance management for each player - Support concurrent playback without interference
🦋 Changeset detectedLatest commit: 788f07f The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis change removes singleton patterns from Vimeo player controller classes, enabling the creation and management of multiple independent player instances. Documentation in both English and Korean is updated to describe and demonstrate multi-instance support, including example code for rendering multiple players concurrently. Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant useVimeoPlayer
participant VimeoView
participant WebviewVimeoPlayerController
App->>useVimeoPlayer: Call hook for each player
useVimeoPlayer->>VimeoView: Pass refs and props
VimeoView->>WebviewVimeoPlayerController: createInstance(webViewRef)
WebviewVimeoPlayerController-->>VimeoView: Return new controller instance
VimeoView-->>useVimeoPlayer: Assign controller to playerRef
Note over VimeoView,WebviewVimeoPlayerController: Each player is managed independently
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying react-native-vimeo-bridge-example with
|
| Latest commit: |
788f07f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e9983b28.react-native-vimeo-bridge-example.pages.dev |
| Branch Preview URL: | https://feat-multiple-player-support.react-native-vimeo-bridge-example.pages.dev |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.changeset/itchy-rooms-crash.md(1 hunks)README-ko_kr.md(2 hunks)README.md(2 hunks)src/VimeoView.tsx(1 hunks)src/VimeoView.web.tsx(1 hunks)src/module/WebVimeoPlayerController.ts(1 hunks)src/module/WebviewVimeoPlayerController.ts(1 hunks)
🔇 Additional comments (10)
src/module/WebVimeoPlayerController.ts (1)
6-8: LGTM! Singleton pattern successfully removed for multi-instance support.The replacement of the singleton pattern with
createInstance()method correctly enables multiple independent player instances. Each call returns a new controller instance, supporting the concurrent player functionality.src/VimeoView.web.tsx (1)
19-19: LGTM! Correctly updated to create new instances.The change from
getInstance()tocreateInstance()properly supports multiple concurrent player instances..changeset/itchy-rooms-crash.md (1)
1-10: LGTM! Changeset properly documents the new feature.The changeset correctly describes the multi-instance support feature with appropriate versioning and clear benefits.
src/VimeoView.tsx (1)
216-216: LGTM! Correctly updated to create new instances.The change from
getInstance()tocreateInstance()properly supports multiple concurrent player instances in the WebView implementation.README.md (2)
19-19: LGTM! Feature list updated to include multi-instance support.The addition to the key features list accurately represents the new capability.
146-165: LGTM! Comprehensive documentation for multiple player support.The new section clearly explains the multi-instance capability with a practical example. The explanation about independent instance management and automatic cleanup is accurate and helpful.
README-ko_kr.md (2)
19-19: LGTM: Clear feature addition to the list.The multi-instance support feature addition is well-placed in the features list and accurately describes the new capability.
146-165: LGTM: Comprehensive documentation for multi-instance support.The new section provides clear explanation of the multi-instance functionality with a practical code example. The Korean translation is accurate and the automatic cleanup mention is important for developers to understand memory management.
src/module/WebviewVimeoPlayerController.ts (2)
141-144: LGTM: Proper cleanup implementation.The
disposemethod correctly clears pending commands and destroys the instance. Since the singleton pattern was removed, there's no need to reset a static instance property.
13-15: Factory Pattern Migration Verified Across ControllersAll controller classes now consistently use the
createInstancefactory method, and nogetInstanceusages remain:
- src/module/WebviewVimeoPlayerController.ts: Lines 13–15 define
static createInstance(webViewRef…).- src/module/WebVimeoPlayerController.ts: Lines 6–8 define
static createInstance().The singleton pattern has been fully removed and replaced with per-call instance creation. Instance-specific cleanup in each class’s
dispose()method remains unchanged and continues to manage resources correctly.No further changes required. Code changes approved.
Summary by CodeRabbit
New Features
Documentation