/    Sign up×
Community /Pin to ProfileBookmark

Sync multiple youtube videos with jquery or javascrip… or any other method ??

i have a big project that must combine at least 4 videos from youtube. For example i would like to have a play button that starts all youtube videos on the page. It looks like the biggest challenge is to keep them in sync with each other, and i mean really in sync, it must be in time without any delay. It can buffer a lot before but really have to stay in sync.

I got something working with youtube videos but it’s not synced…

If anyone have a better idea for doing this, or not with youtube, or with another service, any suggestion is appreciated!

Thanks!

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@SnowmangDec 04.2015 — What's causing the delay between the videos? Also what function is tied into your button when it's clicked?
Copy linkTweet thisAlerts:
@matrixmodulatorauthorDec 04.2015 — What's causing the delay between the videos? Also what function is tied into your button when it's clicked?[/QUOTE]

For the moment they start automaticly.

I will change for a button later.

http://codepen.io/n0rke/pen/YwzXNp

Look at this code pen you will understand what is going on.

Sometimes it's sync sometimes it's not.
Copy linkTweet thisAlerts:
@SnowmangDec 04.2015 — Ok seems like different buffering speeds, you could do a pause statement right under the play statement for the function in the event, then have a setTimeout function to recall the play statement after 1-2 seconds. There may be another way to get the videos to buffer even before play but I think it has to do with clearing each client's cookies and cache.
Copy linkTweet thisAlerts:
@SnowmangDec 04.2015 — the event being the event listener attached to the button*
Copy linkTweet thisAlerts:
@matrixmodulatorauthorDec 04.2015 — the event being the event listener attached to the button*[/QUOTE]

Thanks !!!

it works now but more test should be done

http://codepen.io/n0rke/pen/YwzXNp
Copy linkTweet thisAlerts:
@SnowmangDec 04.2015 — Nice! One thing I noticed though was that after they finish, the 2nd video replays again. Probably just haven't got to that part yet but gonna put it out there anyway.
Copy linkTweet thisAlerts:
@matrixmodulatorauthorDec 04.2015 — Nice! One thing I noticed though was that after they finish, the 2nd video replays again. Probably just haven't got to that part yet but gonna put it out there anyway.[/QUOTE]

Yes i will finish this detail later.

Also i will try to make it pause if the user change the tab in the browser because it lags here when i change tabs...
×

Success!

Help @matrixmodulator spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...