chris-morgan / tty-player

<tty-player>: <video>, but for ttyrec scripts
MIT License
90 stars 7 forks source link

using ttyrec file content instead of its path! #4

Closed zotherstupidguy closed 8 years ago

zotherstupidguy commented 8 years ago

Hello @chris-morgan , first of all, thanks for this amazing library! your work really shows how dedicated you are!! its absolutely brilliant and i love it!

Is there a way of populating the video or tty-player tags with the file contents of a ttyrec recording instead of merely giving it the file path? I expect this to be important when using ajax to send ttyrec recording content to the a web client that makes use of tty-player.

zotherstupidguy commented 8 years ago

Thanks, figoured it out by using Base64 encoding!!

Awesome work!!

Nakilon commented 3 years ago

Can't figure it out. I've copypasted the js and added the video tag like this:

...
  });
};

customElements.define("tty-player", TTYPlayerElement);
})();
</script>

<tty-player autoplay controls loop src="data:application/x-ttyrec;base64,fI1vYb6aCgCpAwAAG1syS
...

but it throws

Uncaught ReferenceError: Terminal is not defined

at

var stockReset = Terminal.prototype["reset"];

UPD: nevermind. Missed the part about including the term.js. See view-source:https://tty-player.chrismorgan.info/examples.html for example.