diff options
author | Chocobozzz <me@florianbigard.com> | 2020-10-26 16:44:23 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | b5b687550d8ef8beafdf706e45d6556fb5f4c876 (patch) | |
tree | 232412d463c78af1f7ab5797db5aecf1096d08da /client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts | |
parent | ef680f68351ec10ab73a1131570a6d14ce14c195 (diff) | |
download | PeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.tar.gz PeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.tar.zst PeerTube-b5b687550d8ef8beafdf706e45d6556fb5f4c876.zip |
Add ability to save live replay
Diffstat (limited to 'client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts')
-rw-r--r-- | client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts b/client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts deleted file mode 100644 index 19b34f984..000000000 --- a/client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | import { Pipe, PipeTransform } from '@angular/core' | ||
2 | |||
3 | @Pipe({ | ||
4 | name: 'myVideoDurationFormatter' | ||
5 | }) | ||
6 | export class VideoDurationPipe implements PipeTransform { | ||
7 | |||
8 | transform (value: number): string { | ||
9 | const hours = Math.floor(value / 3600) | ||
10 | const minutes = Math.floor((value % 3600) / 60) | ||
11 | const seconds = value % 60 | ||
12 | |||
13 | if (hours > 0) { | ||
14 | return $localize`${hours} h ${minutes} min ${seconds} sec` | ||
15 | } | ||
16 | |||
17 | if (minutes > 0) { | ||
18 | return $localize`${minutes} min ${seconds} sec` | ||
19 | } | ||
20 | |||
21 | return $localize`${seconds} sec` | ||
22 | } | ||
23 | } | ||