L
L
Lecturer2019-07-30 22:18:55
YouTube
Lecturer, 2019-07-30 22:18:55

How to make such player on Youtube video?

How to make such player on Youtube video? The video will be from Youtube, but the customer basically wants it to look like this
5d40981b07a03976859645.jpeg

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Aksentiev, 2019-07-30
@Sanasol

The most easy option, any picture => click => replacing the image with the player
. Also, the bonus is that the player does not load the page when the site is opened. (hello PageSpeed ​​and others)

$('[data-video]').click(function() {
        video = '<iframe width="100%" height="315" src="https://www.youtube-nocookie.com/embed/asdasdasd?controls=0&autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
        $(this).replaceWith(video);
    });

V
Vladimir, 2019-07-30
@Casufi

https://developers.google.com/youtube/player_parameters

X
xmoonlight, 2019-07-30
@xmoonlight

API
https://habr.com/en/post/306726/

P
profesor08, 2019-07-31
@profesor08

If you are not satisfied with the standard interface of the player, then hide the player (opacity: 0) and show a stub, by clicking on which show the player and hide the stub, while starting playback. Thus, you will not have anything to jump, jump, load, etc. Loading an iframe with a video is already asynchronous, so it's not necessary to take a steam bath.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question