Answer the question
In order to leave comments, you need to log in
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();
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question