-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Feature]: Support of a Timing Object for Synchronized Multi-Angle Video Playback #3678
Comments
Hello, Idea is well understood on my side. BTW, I have few questions (Please, let's focus on android first, I know this platform better): Q3 / proposal: regarding to API (thank you for the suggestion), Can I suggest something like this ? import React from 'react';
import { SynchronizedVideo, VideoPlayer } from './components';
export default function MyComponent() {
const timingControl = useRef(); // Handle timing across video players
const playAll = () => timingControl.play();
const pauseAll = () => timingControl.pause();
const seekAll = (time) => timingControl.seek(time);
return (
<SynchronizedVideo ref={timingControl}>
{videos.map((video, index) => (
<Video
key={index}
source={video.uri}
/>
))}
</VStack>
);
} Then new SynchronizedVideo component will dispatch actions to all sub Video Component. Q4: do you have any other requirements on DRM, playback window (I think you have a live windows as you talking about seek), or addiotional input you can share ? Q5: if you find some docs on how to synchronize multiple video with exoplayer, I am interested to review it (I did find for now) |
hello there! Just wanted to give a quick response to let you know that I'm working up a response to these questions. I have to discuss with my team and then I'll post back here 🥳 Thank you for the feedback! |
Alrighty, spoke to my team and got some answers :) Q1: Synchronization in Initial TestsWe have attempted to synchronize multiple video instances (both live and VOD), but we encounter slight discrepancies in start times even when we loop through each reference and command Q2: Buffer ConfigurationI have experimented with different buffer configurations; however, even optimized settings do not fully eliminate the millisecond delays between player synchronizations. If there are methods to execute playback commands simultaneously across all instances at precisely the same time, I would be interested in exploring them. Q3: API ProposalThe API proposal you've suggested with Q4: Focus Shift and RequirementsWe've decided to initially focus on VOD synchronization. Our VOD content will be delivered via HLS. Concerning video duration synchronization, leveraging Unix epoch times for alignment seems viable as suggested by the ExoPlayer documentation. For us, we'll ensure that the duration of each video source are the same on the backend; so, I'd like to hear your thoughts on how we could handle situations where those who wish to implement this feature and have durations that do not match or when there are discrepancies in the source timelines. Q5: DocumentationI've found some things; but, they are for https://developer.apple.com/documentation/avfoundation/sample_buffer_playback This seems more concerned with syncing media with animation; but, I figured I'd share anyway. https://developer.apple.com/documentation/avfoundation/avsynchronizedlayer Additional Input and CollaborationI have some experimental code that might be useful as we develop this feature. I am open to sharing this and discussing further to refine the implementation. Please let me know how you would prefer to proceed if that interests you. Looking forward to your thoughts and any further suggestions you might have 🧑🔧 |
Description
Implement a feature in react-native-video to allow multiple video instances to be controlled by a single set of controls, ensuring synchronized playback across all instances.
Why it is needed ?
There is a growing demand for multi-angle video content where users can view the same scene from different perspectives in real-time. Content creators and app developers need a seamless way to synchronize multiple video streams to provide an immersive viewing experience. This feature is crucial for applications in sports, events, and security, where multi-perspective playback adds value to the user experience.
Possible implementation
Integrate a timing object model, similar to the one described at WebTiming, which will allow the react-native-video component to synchronize with a master timing source. This will enable a VStack (or similar layout structure) to house multiple react-native-video instances that can be controlled by a unified timing mechanism.
Code sample
example:
The text was updated successfully, but these errors were encountered: