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 | |
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')
3 files changed, 1 insertions, 26 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 | } | ||
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html index 13242a2bc..bc1c302de 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html | |||
@@ -270,7 +270,7 @@ | |||
270 | 270 | ||
271 | <div class="video-attribute"> | 271 | <div class="video-attribute"> |
272 | <span i18n class="video-attribute-label">Duration</span> | 272 | <span i18n class="video-attribute-label">Duration</span> |
273 | <span class="video-attribute-value">{{ video.duration | myVideoDurationFormatter }}</span> | 273 | <span class="video-attribute-value">{{ video.duration | myDurationFormatter }}</span> |
274 | </div> | 274 | </div> |
275 | </div> | 275 | </div> |
276 | 276 | ||
diff --git a/client/src/app/+videos/+video-watch/video-watch.module.ts b/client/src/app/+videos/+video-watch/video-watch.module.ts index 612bbccc4..21aa33b84 100644 --- a/client/src/app/+videos/+video-watch/video-watch.module.ts +++ b/client/src/app/+videos/+video-watch/video-watch.module.ts | |||
@@ -15,7 +15,6 @@ import { VideoCommentsComponent } from './comment/video-comments.component' | |||
15 | import { VideoSupportComponent } from './modal/video-support.component' | 15 | import { VideoSupportComponent } from './modal/video-support.component' |
16 | import { RecommendationsModule } from './recommendations/recommendations.module' | 16 | import { RecommendationsModule } from './recommendations/recommendations.module' |
17 | import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive' | 17 | import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive' |
18 | import { VideoDurationPipe } from './video-duration-formatter.pipe' | ||
19 | import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' | 18 | import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' |
20 | import { VideoWatchRoutingModule } from './video-watch-routing.module' | 19 | import { VideoWatchRoutingModule } from './video-watch-routing.module' |
21 | import { VideoWatchComponent } from './video-watch.component' | 20 | import { VideoWatchComponent } from './video-watch.component' |
@@ -46,7 +45,6 @@ import { VideoWatchComponent } from './video-watch.component' | |||
46 | VideoCommentComponent, | 45 | VideoCommentComponent, |
47 | 46 | ||
48 | TimestampRouteTransformerDirective, | 47 | TimestampRouteTransformerDirective, |
49 | VideoDurationPipe, | ||
50 | TimestampRouteTransformerDirective | 48 | TimestampRouteTransformerDirective |
51 | ], | 49 | ], |
52 | 50 | ||