Revert "make orgy youtube video autoplay (works only in these cases https://stackoverflow.com/a/50890610)"
This reverts commit 2fe4c51565
.
pull/211/head
parent
3b7697e149
commit
f97f1f160c
|
@ -1,48 +0,0 @@
|
|||
//youtube
|
||||
const playbtn = document.querySelector('#orgy-file-container > lite-youtube > .lty-playbtn')
|
||||
if (playbtn) playbtn.click()
|
||||
|
||||
|
||||
//file
|
||||
const orgy_file = document.getElementById('orgy-file');
|
||||
if (orgy_file) {
|
||||
const break_file = document.getElementById('break-file');
|
||||
|
||||
addEventListener("load", () => {
|
||||
orgy_file.play()
|
||||
});
|
||||
document.addEventListener('click', () => {
|
||||
if (orgy_file.paused) orgy_file.play();
|
||||
}, {once : true});
|
||||
|
||||
function add_playing_listener() {
|
||||
orgy_file.addEventListener('playing', () => {
|
||||
const now = Date.now() / 1000;
|
||||
const created_utc = orgy_file.dataset.created_utc
|
||||
orgy_file.currentTime = now - created_utc
|
||||
}, {once : true});
|
||||
}
|
||||
|
||||
add_playing_listener()
|
||||
|
||||
orgy_file.addEventListener('pause', () => {
|
||||
add_playing_listener()
|
||||
})
|
||||
|
||||
orgy_file.addEventListener("timeupdate", function(){
|
||||
if (break_file.dataset.run == "0" && parseInt(orgy_file.currentTime) == 3000) {
|
||||
break_file.dataset.run = "1"
|
||||
orgy_file.pause();
|
||||
orgy_file.classList.add('d-none');
|
||||
break_file.classList.remove('d-none');
|
||||
break_file.play()
|
||||
setTimeout(function () {
|
||||
break_file.pause()
|
||||
break_file.classList.add('d-none');
|
||||
orgy_file.classList.remove('d-none');
|
||||
orgy_file.dataset.created_utc = parseInt(orgy_file.dataset.created_utc) + 303
|
||||
orgy_file.play()
|
||||
}, 300000);
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
const orgy_file = document.getElementById('orgy-file');
|
||||
const break_file = document.getElementById('break-file');
|
||||
|
||||
addEventListener("load", () => {
|
||||
orgy_file.play()
|
||||
});
|
||||
document.addEventListener('click', () => {
|
||||
if (orgy_file.paused) orgy_file.play();
|
||||
}, {once : true});
|
||||
|
||||
function add_playing_listener() {
|
||||
orgy_file.addEventListener('playing', () => {
|
||||
const now = Date.now() / 1000;
|
||||
const created_utc = orgy_file.dataset.created_utc
|
||||
orgy_file.currentTime = now - created_utc
|
||||
}, {once : true});
|
||||
}
|
||||
|
||||
add_playing_listener()
|
||||
|
||||
orgy_file.addEventListener('pause', () => {
|
||||
add_playing_listener()
|
||||
})
|
||||
|
||||
orgy_file.addEventListener("timeupdate", function(){
|
||||
if (break_file.dataset.run == "0" && parseInt(orgy_file.currentTime) == 3000) {
|
||||
break_file.dataset.run = "1"
|
||||
orgy_file.pause();
|
||||
orgy_file.classList.add('d-none');
|
||||
break_file.classList.remove('d-none');
|
||||
break_file.play()
|
||||
setTimeout(function () {
|
||||
break_file.pause()
|
||||
break_file.classList.add('d-none');
|
||||
orgy_file.classList.remove('d-none');
|
||||
orgy_file.dataset.created_utc = parseInt(orgy_file.dataset.created_utc) + 303
|
||||
orgy_file.play()
|
||||
}, 300000);
|
||||
}
|
||||
});
|
|
@ -27,6 +27,7 @@
|
|||
<track label="English" kind="subtitles" srclang="en" src="/assets/subtitles.vtt?x={{subtitles_hash}}" default>
|
||||
</video>
|
||||
<video id="break-file" class="d-none" controls preload="none" src="/assets/break.mp4" data-run="0"></video>
|
||||
<script defer src="{{'js/orgy_file.js' | asset}}"></script>
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -55,5 +56,4 @@
|
|||
<script defer src="{{'js/vendor/lozad.js' | asset}}"></script>
|
||||
<script defer src="{{'js/vendor/lite-youtube.js' | asset}}"></script>
|
||||
<script defer src="{{'js/chat.js' | asset}}"></script>
|
||||
<script defer src="{{'js/orgy.js' | asset}}"></script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue