Skip to content

Commit

Permalink
fix(is-playing): CornerstoneViewport now plays the clip on mounting i…
Browse files Browse the repository at this point in the history
…f isPlaying is true (#53)
  • Loading branch information
dbousamra authored and dannyrb committed Dec 17, 2019
1 parent 7ee4577 commit 939bb63
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/CornerstoneViewport/CornerstoneViewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class CornerstoneViewport extends Component {
cornerstoneOptions,
imageIds,
resizeThrottleMs,
isPlaying,
frameRate,
} = this.props;
const { imageIdIndex } = this.state;
const imageId = imageIds[imageIdIndex];
Expand Down Expand Up @@ -174,6 +176,11 @@ class CornerstoneViewport extends Component {
_enableStackPrefetching(this.element);
}

if (isPlaying) {
const validFrameRate = Math.max(frameRate, 1);
cornerstoneTools.playClip(this.element, validFrameRate);
}

_addAndConfigureInitialToolsForElement(tools, this.element);
_trySetActiveTool(this.element, this.props.activeTool);
this.setState({ isLoading: false });
Expand Down

0 comments on commit 939bb63

Please sign in to comment.