Support for receiving View Once Video
This commit is contained in:
parent
9229824c24
commit
5c00b89600
9 changed files with 156 additions and 48 deletions
13
ts/util/formatDuration.ts
Normal file
13
ts/util/formatDuration.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import moment from 'moment';
|
||||
|
||||
const HOUR = 1000 * 60 * 60;
|
||||
|
||||
export function formatDuration(seconds: number) {
|
||||
const time = moment.utc(seconds * 1000);
|
||||
|
||||
if (seconds > HOUR) {
|
||||
return time.format('H:mm:ss');
|
||||
}
|
||||
|
||||
return time.format('m:ss');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue