Hi friends. I am trying to show the image of what is being played in a media_player object.
But I would like the image of each media_player to be displayed every two seconds. I wanted to show an image every two seconds and I am doing something wrong. Something is wrong, I don’t know if it’s my code or that the old_time variable is actually being updated as well.
If anyone sees what I did wrong I would appreciate your help.
Thank you
reproducciones:
name: Reproduccion Actual
variables:
old_time: Date.now();
styles:
custom_fields:
media_image:
- background-position: center center
- background-image: >
[[[
let time = Date.now() - variables.old_time;
if (time > 4000)
return "url('/local/img/1.png')";
else if (time > 2000)
return "url('/local/img/2.png')";
else
return "url('/local/img/3.pgn')";
]]]