Skip to content

Commit 939bb63

Browse files
dbousamradannyrb
authored andcommitted
fix(is-playing): CornerstoneViewport now plays the clip on mounting if isPlaying is true (#53)
1 parent 7ee4577 commit 939bb63

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/CornerstoneViewport/CornerstoneViewport.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ class CornerstoneViewport extends Component {
133133
cornerstoneOptions,
134134
imageIds,
135135
resizeThrottleMs,
136+
isPlaying,
137+
frameRate,
136138
} = this.props;
137139
const { imageIdIndex } = this.state;
138140
const imageId = imageIds[imageIdIndex];
@@ -174,6 +176,11 @@ class CornerstoneViewport extends Component {
174176
_enableStackPrefetching(this.element);
175177
}
176178

179+
if (isPlaying) {
180+
const validFrameRate = Math.max(frameRate, 1);
181+
cornerstoneTools.playClip(this.element, validFrameRate);
182+
}
183+
177184
_addAndConfigureInitialToolsForElement(tools, this.element);
178185
_trySetActiveTool(this.element, this.props.activeTool);
179186
this.setState({ isLoading: false });

0 commit comments

Comments
 (0)