Link to home
Create AccountLog in
Avatar of Geeth Janarthanan
Geeth Janarthanan

asked on

How to play two Youtube videos in sync in PHP?

When page load One video is already played Having button show lyrics video,

Once user click lyrics video button show the Lyrics youtube video at the same page.

1. Now two Youtube videos play sync and automatically play Lyrics video is muted.

2. Once one Youtube video is Pause automatically other video too paused.

3. Once one Youtube video is Play automatically other video too Play.

Is it possible Done in php/JS my above scenario.

Once Possible Please give me solution.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Keep in mind, you can only start two videos simultaneously.

This means they will start out in sync + desync over time. The longer they play, the more pronounced the desync.

The easy way to maintain 100% sync over entire span of videos is to transcode them together as an over-under or side-by-side video. This will cause both videos to play with the exact same clock.
Poster has stopped posting.

Julian's answer seems best.