1 var util
= require("./utilities");
3 function Media(id
, title
, seconds
, type
, meta
) {
11 this.seconds
= seconds
=== "--:--" ? 0 : parseInt(seconds
);
12 this.duration
= util
.formatTime(seconds
);
20 setTitle: function (title
) {
22 if (this.title
.length
> 100) {
23 this.title
= this.title
.substring(0, 97) + "...";
31 seconds
: this.seconds
,
32 duration
: this.duration
,
35 direct
: this.meta
.direct
,
36 restricted
: this.meta
.restricted
,
37 codec
: this.meta
.codec
,
38 bitrate
: this.meta
.bitrate
,
39 scuri
: this.meta
.scuri
,
40 embed
: this.meta
.embed
,
41 gdrive_subtitles
: this.meta
.gdrive_subtitles
46 getTimeUpdate: function () {
48 currentTime
: this.currentTime
,
53 getFullUpdate: function () {
54 var packed
= this.pack();
55 packed
.currentTime
= this.currentTime
;
56 packed
.paused
= this.paused
;
66 module
.exports
= Media
;