setInterval(() => {
setMedia(() => mediaFromPlayer(player))
}, 20)
useEffect(() => {
const updateMedia = () => {
setMedia(mediaFromPlayer(player));
};
const intervalId = setInterval(updateMedia, 100); // Adjust the interval as needed
return () => clearInterval(intervalId); // Cleanup on unmount
}, [player]);
<?php
$file = 'views.txt';
$current = (int) file_get_contents($file);
$current++;
file_put_contents($file, $current);
?>
<h1>Просмотров: <?php echo $current;?></h1>
$array = array('1st element', '2nd element', '3rd element');
unset($array[0]);
document.getElementById('OBJECT ID').addEventListener('keydown', function(clickevent) {
if (clickevent.key=='Tab') {
var begin = this.selectionStart;
var e = this.selectionEnd;
this.value = this.value.substring(0, begin)+"\t"+this.value.substring(e);
this.selectionStart = this.selectionEnd = begin+1;
clickevent.preventDefault();
}
});