song: add duration property

This commit is contained in:
Androz2091 2020-01-18 18:40:06 +01:00
parent fb2b00a212
commit ef8be9b148
2 changed files with 74 additions and 0 deletions

View file

@ -289,6 +289,75 @@
</div>
<div class="section-members">
<h4 class="name" id="duration"><span class="type-signature"></span>duration<span class="type-signature"> :Number</span></h4>
<div class="description">
<p>Song duration.</p>
</div>
<dl class="details">
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><code>Number</code></span>
</li>
</ul>
</div>

View file

@ -12,6 +12,11 @@ class Song {
* @type {string}
*/
this.name = video.title;
/**
* Song duration.
* @type {Number}
*/
this.duration = ((video.duration.hours*3600)+(video.duration.minutes*60)+(video.duration.seconds)) * 100;
/**
* Raw informations about the song.
* @type {Object}