Commit 38c61a5069cfd7444fd36af69b49b22d92af5f4d
Support audio and video elements
cel committed on 9/10/2020, 2:31:58 AMParent: aa1697181e2065d65b336d19ad06501921b37c39
Files changed
render.js | changed |
render.js | ||
---|---|---|
@@ -54,8 +54,20 @@ | ||
54 | 54 … | return h('object', |
55 | 55 … | { type: 'image/svg+xml', |
56 | 56 … | data: href, |
57 | 57 … | alt: text }).outerHTML |
58 … | + else if (/^video:/.test(text)) | |
59 … | + return h('video', { | |
60 … | + controls: 'controls', | |
61 … | + src: this.opts.blob_base + href, | |
62 … | + title: title || undefined | |
63 … | + }).outerHTML | |
64 … | + else if (/^audio:/.test(text)) | |
65 … | + return h('audio', { | |
66 … | + controls: 'controls', | |
67 … | + src: this.opts.blob_base + href, | |
68 … | + title: title || undefined | |
69 … | + }).outerHTML | |
58 | 70 … | else |
59 | 71 … | return h('img', |
60 | 72 … | { src: this.opts.img_base + href, |
61 | 73 … | alt: text, |
Built with git-ssb-web