* Updates the current time and index of the caption instance * @param {Number} [time=0] * @memberof Caption
(time = 0)
| 117 | * @memberof Caption |
| 118 | */ |
| 119 | updateTimeIndex(time = 0) { |
| 120 | this.time = time; |
| 121 | if (this.isFinished()) { |
| 122 | return; |
| 123 | } |
| 124 | for (let i = this.lines.length - 1; i > -1; i--) { |
| 125 | if (this.lines[i].startTime <= time) { |
| 126 | this.lineIndex = i; |
| 127 | break; |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | } |