Custom auto scrolling for AIMP track info

Hemotoxine

New Member
such the problem. I output the full name of a track from Aimp using a plugin in txt file. then I somehow put its contents in the HTML body (this is not important now). for some reason, in my case, it refuses to work outside of codepen - both in the browser and in OBS. I just don't know much about the topic and it's hard for me to understand. I have a fixed container size for the name of the track in OBS with dimensions, for example, 1000x300. I want to scroll the name of the song in one line without wrapping, depending on its length. if the length of the text is greater than the container, then do animation; if not, then the track name will be static and aligned, for example, to the left. The javascript code in the example does just that. I can't understand why animations don't work and where the error is. The code is not mine, I just found an example that almost suits me.

Codepen link i used. https://codepen.io/pawankolhe/pen/abvMjGB

Example number 2.

or maybe there are already some ready-made solutions?
 

Hemotoxine

New Member
Solved. I figured it out. If someone needs it, it only works in OBS, not in the browser. The AIMP plugin inserts the name of the song into the stream.txt file, I open it in html with a script that auto-updates info every second. In OBS I insert the HTML source using Browser Source - a local file. it scrolls text left and right until the edges of the box intersect with the beginning or end of the title, if the length of the text is longer than the container. if less than or equal, then the text is static. Default size 1000x100px
 

Attachments

  • scrolling.zip
    1.1 KB · Views: 32
Last edited:
Top