???
Con tutto il rispetto, questo è un codice pessimo, terribile.
Eseguirà una funzione ogni 10 millisecondi che non funzionerà nel 99% dei casi, il che è un enorme spreco di prestazioni.
Certo, un computer domestico potrebbe sostenere la spesa… ma è semplicemente così inelegante.
IMHO this is very bad code, awful.
It will run a function every 10 milliseconds that will not work 99% of the time, which is a huge waste of performance.
Sure, a home computer could support the expense… but it’s just so inelegant
Dovresti usare l’API di Discourse per fare questo. usa questo:
You should use discourse’s API to do this. use this:
<script type="text/discourse-plugin" version="0.8">
api.onPageChange(() => {
if (document.querySelector("video")) {
new Plyr('video');
}
});
</script>
Dovresti semplicemente chiedermi (sto scherzando)