P
P
pitimirov_a2015-07-04 01:42:05
YouTube
pitimirov_a, 2015-07-04 01:42:05

What player can I use to play YouTube videos on the site?

Necessary conditions:
- autorun
- cycling
idaspin.ru/hi.html
The current working page. Loop works on both android and desktop, but the video does not start automatically on the tablet. On one of the forums I found this code, but it does not work.

function fakeClick(fn) {
            var $a = $('<a href="#" id="fakeClick"></a>');
                $a.bind("click", function(e) {
                    e.preventDefault();
                    fn();
                });

            $("body").append($a);

            var evt, 
                el = $("#pl").get(0);

            if (document.createEvent) {
                evt = document.createEvent("MouseEvents");
                if (evt.initMouseEvent) {
                    evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
                    el.dispatchEvent(evt);
                }
            }

            $(el).remove();
        }

        $(function() {
            var video = $("#pl").get(0);

            fakeClick(function() {
                video.play();
            });
        });

There is an option: switch different players. But with what player can you play YouTube videos on the site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2015-07-04
@xmoonlight

With official
UPD: jwplayer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question