asciinema-server
asciinema-server copied to clipboard
Host asciinema-player.js/.css at known location for easier player embedding
We could serve asciinema-player.js and asciinema-player.css from asciinema.org so people could use the player in their HTML without downloading anything. (technically it's there somewhere in /assets but it's not official and not recommended to rely on its location right now)
We should have player version number in the URL, for example:
https://asciinema.org/dist/player/v2.4.1/asciinema-player.jshttps://asciinema.org/dist/player/v2.4.1/asciinema-player.csshttps://asciinema.org/dist/player/v2.0.0/asciinema-player.jshttps://asciinema.org/dist/player/v2.0.0/asciinema-player.css
and so on.
Then, one could use the player via <asciinema-player> tag directly (having access to its DOM element for programmatic control etc), by linking to JS bundle on asciinema.org:
<html>
<head>
...
<link rel="stylesheet" type="text/css" href="https://asciinema.org/dist/player/v2.4.1/asciinema-player.css" />
...
</head>
<body>
...
<asciinema-player src="/demo.json"></asciinema-player>
...
<script src="https://asciinema.org/dist/player/v2.4.1/asciinema-player.js"></script>
</body>
</html>
I don't see a reason to start with any version older than the latest one released.
Initially it could be as simple as redirecting to Github release URL (https://github.com/asciinema/asciinema-player/releases/download/v2.4.1/asciinema-player.js).
Further down the road it may be nice to use CDN for this.
Someone added asciinema-player to cdnjs.com - https://cdnjs.com/libraries/asciinema-player 👍
The latest release on cdnjs is v2.4.1, which doesn't seem to work with recordings from current asciinema.
It seems cdnjs has the latest one (3.3.0 as of this writing) so I'm going to close this.
https://cdnjs.com/libraries/asciinema-player