Show videos, animations or text in Mac's touchbar
Given that the mac's touchbar is an actual display would it be possible to do things like display arbitrary text, a video or an animation in the touchbar?
For example, what would it take to display a text file, an animated png/gif or mp4 in the touchbar?
Is there an API that allows doing it and/or are there apps that implement the API and provide a UI to do it?
Ideally I would like to see the API exposed via AppleScript so that one could do something like
-- pseudo-code
tell application "System Events"
display touchbar text 'hello touchbar'
end tell
This little snippet from Developer HIG indicates that animations are possible in the Touch Bar:
Avoid animation. The Touch Bar is an extension of the keyboard, and people don’t expect animation in their keyboard. In addition, excessive or gratuitous animation can distract people from their work.
https://developer.apple.com/design/human-interface-guidelines/macos/touch-bar/touch-bar-visual-design/