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

Method constructor

src/localization/captions/Caption.js:19–36  ·  view source on GitHub ↗

* Creates an instance of Caption. * @param {TimedLine[]} lines - Array of lines to be used for caption. * @memberof Caption

(lines)

Source from the content-addressed store, hash-verified

17 * @memberof Caption
18 */
19 constructor(lines) {
20 this.lines = lines;
21
22 // Sort by end time, this ensures proper execution order of lines.
23 this.lines.sort(function (a, b) {
24 if (a.endTime < b.endTime) {
25 return -1;
26 }
27
28 if (a.endTime > b.endTime) {
29 return 1;
30 }
31
32 return 0;
33 });
34
35 this.reset();
36 }
37
38 /**
39 * Resets time, lineIndex and content fields.

Callers

nothing calls this directly

Calls 1

resetMethod · 0.95

Tested by

no test coverage detected