MCPcopy
hub / github.com/midrender/revideo / togglePlayback

Method togglePlayback

packages/core/src/app/Player.ts:245–264  ·  view source on GitHub ↗
(
    value: boolean = this.playerState.current.paused,
  )

Source from the content-addressed store, hash-verified

243 }
244
245 public togglePlayback(
246 value: boolean = this.playerState.current.paused,
247 ): void {
248 if (value === this.playerState.current.paused) {
249 this.playerState.current = {
250 ...this.playerState.current,
251 paused: !value,
252 };
253
254 // hitting play after the animation has finished should reset the
255 // playback, even if looping is disabled.
256 if (
257 value &&
258 !this.playerState.current.loop &&
259 this.playback.frame === this.playback.duration
260 ) {
261 this.requestReset();
262 }
263 }
264 }
265
266 public toggleAudio(value: boolean = this.playerState.current.muted): void {
267 if (value === this.playerState.current.muted) {

Callers 7

prepareMethod · 0.95
runMethod · 0.95
setPlayingMethod · 0.80
updateSourceMethod · 0.80
setPlayingMethod · 0.80
updateProjectMethod · 0.80
PlaybackControlsFunction · 0.80

Calls 1

requestResetMethod · 0.95

Tested by

no test coverage detected