(frame: number)
| 81 | } |
| 82 | |
| 83 | public async seek(frame: number): Promise<boolean> { |
| 84 | if ( |
| 85 | frame <= this.frame || |
| 86 | (this.currentScene.isCached() && this.currentScene.lastFrame < frame) |
| 87 | ) { |
| 88 | const scene = this.findBestScene(frame); |
| 89 | if (scene !== this.currentScene) { |
| 90 | this.currentScene.stopAllMedia(); |
| 91 | this.previousScene = null; |
| 92 | this.currentScene = scene; |
| 93 | |
| 94 | this.frame = this.currentScene.firstFrame; |
| 95 | await this.currentScene.reset(); |
| 96 | } else if (this.frame >= frame) { |
| 97 | this.previousScene = null; |
| 98 | this.frame = this.currentScene.firstFrame; |
| 99 | await this.currentScene.reset(); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | this.finished = false; |
| 104 | while (this.frame < frame && !this.finished) { |
| 105 | this.finished = await this.next(); |
| 106 | } |
| 107 | |
| 108 | return this.finished; |
| 109 | } |
| 110 | |
| 111 | public async reset() { |
| 112 | this.previousScene = null; |
no test coverage detected