Я написал небольшое дополнение к Firefox в javascript, чтобы автоматически загрузить следующий эпизод сериала на маленький потоковый сайт и автоматически воспроизвести его.
var video = document.getElementsByTagName('video')[0];
video.addEventListener('canplaythrough', function () {
setTimeout(function () {
if (video.currentTime == 0)
video.play();
}, 2000)
});
video.addEventListener('ended', function () {
var next = document.querySelector('[title="next episode"]').click();
});
Когда видео закончится, страницаследующее видео загружено правильно, но новое видео не может быть воспроизведено.
NotAllowedError: The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
Есть ли какое-нибудь решение?