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