Support for receiving View Once Video

This commit is contained in:
Scott Nonnenberg 2019-10-03 12:03:46 -07:00
parent 9229824c24
commit 5c00b89600
9 changed files with 156 additions and 48 deletions

13
ts/util/formatDuration.ts Normal file
View 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');
}