forked from SpringRoll/SpringRoll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimedLine.js
31 lines (30 loc) · 846 Bytes
/
TimedLine.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* @export
* @property {number} startTime
* @property {number} endTime
* @property {string} content
* @class TimedLine
*/
export class TimedLine {
/**
* Creates an instance of TimedLine.
* @param {Number} startTime - Start time in milliseconds relative to caption.
* @param {Number} endTime - End time in milliseconds relative to caption.
* @param {string} content - HMTL formatted string content to show during time-span.
* @memberof TimedLine
*/
constructor(startTime, endTime, content) {
this.startTime = startTime || 0;
this.endTime = endTime || 0;
this.content = '';
this.setContent(content);
}
/**
* Sets line's content. Removes HTML formatting for text.
* @param {any} content
* @return {void}@memberof TimedLine
*/
setContent(content) {
this.content = content;
}
}