git ssb

16+

Dominic / patchbay



Tree: ab8ee40465e79539b0e4acbeab2ffeae09f070d8

Files: ab8ee40465e79539b0e4acbeab2ffeae09f070d8 / modules_extra / audio-mp3.js

1425 bytesRaw
1var markdown = require('ssb-markdown');
2var h = require('hyperscript');
3var u = require('../util');
4var ref = require('ssb-ref');
5
6//render a message
7
8exports.needs = {
9// message_link: 'first',
10// message_confirm: 'first',
11// sbot_links: 'first',
12 blobs_url: 'first'
13}
14
15exports.gives = 'message_content'
16
17exports.create = function (api) {
18
19 return function(msg) {
20 if (msg.value.content.type !== 'audio-mp3')
21 return;
22
23 var v = msg.value.content;
24 return h('div',
25 h('h2', "(" + v.Track + ") " + v.Title),
26 // h('img', { "src" : api.blob_url(v.cover) }),
27 h('audio', {
28 "controls" : true,
29 "src" : api.blob_url(v.link)
30 }))
31 // h('dl',
32 // Object.keys(v).map(function(k) {
33 // return [
34 // h("dt", k),
35 // h("dd", v[k]),
36 // ]
37 // })))
38
39 // "Album": "the fall of",
40 // "Crc32": "038becab",
41 // "Creator": "bleupulp",
42 // "Format": "VBR MP3",
43 // "Height": "0",
44 // "Length": "375.23",
45 // "Md5": "2c517c8e813da5f940c8c7e77d4b7f3f",
46 // "Mtime": "1399498698",
47 // "Name": "2_bleupulp_-_clouds.mp3",
48 // "Sha1": "9f6a96a3d5571ed1ec2a7da38ffebdcd5f181482",
49 // "Size": "15009000",
50
51 // "Title": "clouds",
52 // "Track": "2",
53 // "Width": "0",
54 }
55}
56
57

Built with git-ssb-web