diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 15:47:18 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 15:47:18 +0200 |
| commit | 34573a4f34c862ee884d0a3fd5badb1d4af1d9c2 (patch) | |
| tree | fcdaf6b6182b92a91447c6fbad733eea7acdda56 /app/client/socket.js | |
| parent | ceb342df85308e45729067d4b56aa5b2fbaabc49 (diff) | |
cmdz
Diffstat (limited to 'app/client/socket.js')
| -rw-r--r-- | app/client/socket.js | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/app/client/socket.js b/app/client/socket.js index cda7058..280e7fe 100644 --- a/app/client/socket.js +++ b/app/client/socket.js @@ -1,7 +1,6 @@ import { store } from './store' let socket = io.connect('/client') -let got_frame = false // SOCKET ACTIONS @@ -27,10 +26,10 @@ socket.on('res', (data) => { checkpoints: data.res, }) break - case 'list_datasets': + case 'list_sequences': store.dispatch({ - type: 'LIST_DATASETS', - datasets: data.res, + type: 'LIST_SEQUENCES', + sequences: data.res, }) break default: @@ -40,35 +39,28 @@ socket.on('res', (data) => { }) socket.on('frame', (data) => { - got_frame = true const blob = new Blob([data.frame], { type: 'image/jpg' }) const url = URL.createObjectURL(blob) const img = new Image () img.onload = function() { URL.revokeObjectURL(url) - const player = document.querySelector('.player') - player.innerHTML = '' - player.appendChild(img) + const player = document.querySelector('.player canvas') + player.getContext('2d') + player.drawImage(img, 0, 0, player.width, player.height) + // player.innerHTML = '' + // player.appendChild(img) } img.src = url }) -setTimeout(() => { - if (!got_frame) { - // socket.emit('cmd', { - // cmd: 'get_last_frame', - // }) - } -}, 500) - export function list_checkpoints() { socket.emit('cmd', { cmd: 'list_checkpoints', }) } -export function list_datasets() { +export function list_sequences() { socket.emit('cmd', { - cmd: 'list_datasets', + cmd: 'list_sequences', }) } export function get_params() { |
