Skip to content

Commit

Permalink
Fix a bug where the Refresh button does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Sep 16, 2016
1 parent 2372271 commit 960c39a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/web/widgets/Webcam/Webcam.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import _ from 'lodash';
import delay from 'delay';
import Slider from 'rc-slider';
import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
import WebcamMedia from 'react-webcam';
import CSSModules from 'react-css-modules';
Expand Down Expand Up @@ -31,11 +32,12 @@ class Webcam extends Component {
const { mediaSource } = state;

if (mediaSource === MEDIA_SOURCE_MJPEG) {
this.refs['mjpeg-media-source'].src = '';
const node = ReactDOM.findDOMNode(this.refs['mjpeg-media-source']);
node.src = '';

delay(10) // delay 10ms
.then(() => {
this.refs['mjpeg-media-source'].src = state.url;
node.src = state.url;
});
}
}
Expand Down

0 comments on commit 960c39a

Please sign in to comment.