tmp: Revert "image: add stream experimental property with server-side ffmpeg backend (#259)"
This reverts commit 774416af96.
This commit is contained in:
parent
c06c653f8d
commit
2722cf43b7
4 changed files with 1 additions and 56 deletions
|
|
@ -1,6 +1,5 @@
|
|||
var {mapToScale} = require('../utils'),
|
||||
Widget = require('../common/widget'),
|
||||
ipc = require('../../ipc')
|
||||
Widget = require('../common/widget')
|
||||
|
||||
module.exports = class Led extends Widget {
|
||||
|
||||
|
|
@ -31,7 +30,6 @@ module.exports = class Led extends Widget {
|
|||
repeat: 'no-repeat',
|
||||
border: true,
|
||||
cache: true,
|
||||
stream: '',
|
||||
|
||||
_value: 'value',
|
||||
default: '',
|
||||
|
|
@ -60,10 +58,6 @@ module.exports = class Led extends Widget {
|
|||
this.widget.style.setProperty('background-position', this.getProp('position'))
|
||||
this.widget.style.setProperty('background-repeat', this.getProp('repeat'))
|
||||
|
||||
if (this.getProp('stream') !== '') {
|
||||
this.bindedOnStreamUpdate = this.onStreamUpdate.bind(this)
|
||||
ipc.on('video', this.bindedOnStreamUpdate)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -95,20 +89,4 @@ module.exports = class Led extends Widget {
|
|||
|
||||
}
|
||||
|
||||
onStreamUpdate(event) {
|
||||
console.log(event)
|
||||
var [stream, data] = event
|
||||
if (stream === this.getProp('stream')) {
|
||||
this.setValue('data:image/jpeg;base64,' + data)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
|
||||
if (this.bindedOnStreamUpdate) ipc.off('video', this.bindedOnStreamUpdate)
|
||||
super.onRemove()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue