diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-07-07 19:18:48 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-07-07 19:18:48 +0200 |
| commit | 3d3a7b80d34c100846c8ae130b424b63ba3c0784 (patch) | |
| tree | 83ba690e72c353b16a3b78c95c2b77ff4c5eee39 /public/bundle.js | |
| parent | b89147ecd38b0f95a2e4917aba7f44bf3bb70327 (diff) | |
socket io communication
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/public/bundle.js b/public/bundle.js index b860674..62ee11b 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -2702,6 +2702,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de // import db from '../db' +var socket = io(window.location.origin); + +socket.on('connect', function (data) { + console.log('connected'); +}); +socket.on('worker', function (data) { + console.log('worker connected', data); +}); +socket.on('processed', function (data) { + console.log('processed', data); +}); + var App = function App() { return (0, _preact.h)( 'div', @@ -8947,10 +8959,6 @@ var Files = function (_Component) { }, { key: 'handleClick', value: function handleClick(file) { - if (file.type === 'audio') { - (0, _actions.audioPlayFile)(file); - document.body.style.backgroundImage = 'url(' + pngpath(file) + ')'; - } this.setState({ selected: file }); } }, { @@ -8975,12 +8983,12 @@ var Files = function (_Component) { (0, _preact.h)( 'span', { 'class': 'mime' }, - file.mime + file.processed ? file.mime : 'working...' ), (0, _preact.h)( 'span', { 'class': 'duration' }, - file.duration.toFixed(1) + 's' + file.duration ? file.duration.toFixed(1) + 's' : '' ), (0, _preact.h)( 'span', @@ -9077,6 +9085,7 @@ var audio = document.createElement('audio'); function AudioPlayer(props) { if (props.file) { + document.body.style.backgroundImage = 'url(' + pngpath(file) + ')'; audio.src = mp3path(props.file); audio.play(); return (0, _preact.h)( |
