MCPcopy Create free account
hub / github.com/SpringRoll/SpringRoll / updateTimeIndex

Method updateTimeIndex

src/localization/captions/Caption.js:119–130  ·  view source on GitHub ↗

* Updates the current time and index of the caption instance * @param {Number} [time=0] * @memberof Caption

(time = 0)

Source from the content-addressed store, hash-verified

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}

Callers 1

startMethod · 0.95

Calls 1

isFinishedMethod · 0.95

Tested by

no test coverage detected