From be5d952536013f75eeb725536a54ad9e92a38b0a Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 1 Sep 2019 20:25:45 -0700 Subject: Render ahau audio messages --- lib/render-msg.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/render-msg.js b/lib/render-msg.js index 82395af..3de96c7 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -286,9 +286,10 @@ RenderMsg.prototype.message = function (cb) { case 'ssb-dns': return this.dns(cb) case 'gathering': return this.gathering(cb) case 'micro': return this.micro(cb) + case 'audio': return this.audio(cb) case 'ferment/audio': case 'robeson/audio': - return this.audio(cb) + return this.fermentAudio(cb) case 'ferment/repost': case 'robeson/repost': return this.repost(cb) @@ -1123,6 +1124,15 @@ function formatDuration(s) { } RenderMsg.prototype.audio = function (cb) { + this.wrapMini([ + h('a', {href: this.toUrl(this.c.blob)}, 'audio'), + isFinite(this.c.format) ? ' (' + this.c.format + ')' : '', + isFinite(this.c.duration) ? ' (' + formatDuration(this.c.duration) + ')' : '', + isFinite(this.c.size) ? ' [' + this.render.formatSize(this.c.size) + ']' : '', + ], cb) +} + +RenderMsg.prototype.fermentAudio = function (cb) { // fileName, fallbackFileName, overview this.wrap(h('table', h('tr', h('td', -- cgit v1.2.3