Files: 3003c7f2e378ab411b09eaa11adef56245af1868 / modules_extra / audio-mp3.js
1701 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.needs = { |
15 | // message_link: 'first', |
16 | // message_confirm: 'first', |
17 | // sbot_links: 'first', |
18 | blobs_url: 'first' |
19 | } |
20 | |
21 | exports.gives = 'message_content' |
22 | |
23 | exports.create = function (api) { |
24 | |
25 | return function(msg) { |
26 | if (msg.value.content.type !== 'audio-mp3') |
27 | return; |
28 | |
29 | var v = msg.value.content; |
30 | return h('div', |
31 | h('h2', "(" + v.Track + ") " + v.Title), |
32 | // h('img', { "src" : api.blob_url(v.cover) }), |
33 | h('audio', { |
34 | "controls" : true, |
35 | "src" : api.blob_url(v.link) |
36 | })) |
37 | // h('dl', |
38 | // Object.keys(v).map(function(k) { |
39 | // return [ |
40 | // h("dt", k), |
41 | // h("dd", v[k]), |
42 | // ] |
43 | // }))) |
44 | |
45 | // "Album": "the fall of", |
46 | // "Crc32": "038becab", |
47 | // "Creator": "bleupulp", |
48 | // "Format": "VBR MP3", |
49 | // "Height": "0", |
50 | // "Length": "375.23", |
51 | // "Md5": "2c517c8e813da5f940c8c7e77d4b7f3f", |
52 | // "Mtime": "1399498698", |
53 | // "Name": "2_bleupulp_-_clouds.mp3", |
54 | // "Sha1": "9f6a96a3d5571ed1ec2a7da38ffebdcd5f181482", |
55 | // "Size": "15009000", |
56 | |
57 | // "Title": "clouds", |
58 | // "Track": "2", |
59 | // "Width": "0", |
60 | } |
61 | } |
62 | |
63 |
Built with git-ssb-web