(
value: boolean = this.playerState.current.paused,
)
| 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) { |
no test coverage detected