aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-watch')
-rw-r--r--client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts23
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.html2
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.module.ts2
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 @@
1import { Pipe, PipeTransform } from '@angular/core'
2
3@Pipe({
4 name: 'myVideoDurationFormatter'
5})
6export 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'
15import { VideoSupportComponent } from './modal/video-support.component' 15import { VideoSupportComponent } from './modal/video-support.component'
16import { RecommendationsModule } from './recommendations/recommendations.module' 16import { RecommendationsModule } from './recommendations/recommendations.module'
17import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive' 17import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive'
18import { VideoDurationPipe } from './video-duration-formatter.pipe'
19import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' 18import { VideoWatchPlaylistComponent } from './video-watch-playlist.component'
20import { VideoWatchRoutingModule } from './video-watch-routing.module' 19import { VideoWatchRoutingModule } from './video-watch-routing.module'
21import { VideoWatchComponent } from './video-watch.component' 20import { 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