forked from ableplayer/ableplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmisc.js
More file actions
25 lines (22 loc) · 622 Bytes
/
Copy pathmisc.js
File metadata and controls
25 lines (22 loc) · 622 Bytes
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
(function ($) {
AblePlayer.prototype.countProperties = function(obj) {
// returns the number of properties in an object
var count, prop;
count = 0;
for (prop in obj) {
if (obj.hasOwnProperty(prop)) {
++count;
}
}
return count;
};
// Takes seconds and converts to string of form mm:ss
AblePlayer.prototype.formatSecondsAsColonTime = function (seconds) {
var dMinutes = Math.floor(seconds / 60);
var dSeconds = Math.floor(seconds % 60);
if (dSeconds < 10) {
dSeconds = '0' + dSeconds;
}
return dMinutes + ':' + dSeconds;
};
})(jQuery);