A
A
Alyosha2017-05-10 18:33:50
JavaScript
Alyosha, 2017-05-10 18:33:50

How to optimize multiple (5 pieces) YouTube video embeds?

How is it fashionable to optimize videos from YouTube?
There is a page, 5 videos from YouTube are stuck into it, which significantly affects the download. There is an idea, take a preview from the video + the name of the video, put the "play" icon on top (disguise it as a regular insert), write something like this in the div attributes for this block:

1) data-youtubesrc=" youtube.com/?v=youryoutubevideoid "
2) onClick="functionName();"

And already on click to insert a vidos player into this block.
Is the game worth the candle? This is the maximum that can be done to optimize?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2017-05-10
@healqq

Maybe you should use the youtube javascript API.
https://developers.google.com/youtube/iframe_api_r...
Well, what you described is also quite easy using this API

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question