diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-14 17:16:32 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-14 17:16:32 +0100 |
commit | 8cac1b6446a97b16387c9590ce5c799a79a759fa (patch) | |
tree | 6ef95c108b9323e47d1b979a01934398b0752dac /client/src/app/shared | |
parent | a16aee73db627908dc83eb5c29b213ce8d1fab39 (diff) | |
download | PeerTube-8cac1b6446a97b16387c9590ce5c799a79a759fa.tar.gz PeerTube-8cac1b6446a97b16387c9590ce5c799a79a759fa.tar.zst PeerTube-8cac1b6446a97b16387c9590ce5c799a79a759fa.zip |
Move adding a video view videojs peertube plugin
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/video/infinite-scroller.directive.ts | 3 | ||||
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/client/src/app/shared/video/infinite-scroller.directive.ts b/client/src/app/shared/video/infinite-scroller.directive.ts index 43e014cbd..52d8b2b37 100644 --- a/client/src/app/shared/video/infinite-scroller.directive.ts +++ b/client/src/app/shared/video/infinite-scroller.directive.ts | |||
@@ -1,5 +1,8 @@ | |||
1 | import { Directive, EventEmitter, Input, OnInit, Output } from '@angular/core' | 1 | import { Directive, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import 'rxjs/add/operator/debounceTime' | ||
2 | import 'rxjs/add/operator/distinct' | 3 | import 'rxjs/add/operator/distinct' |
4 | import 'rxjs/add/operator/filter' | ||
5 | import 'rxjs/add/operator/map' | ||
3 | import 'rxjs/add/operator/startWith' | 6 | import 'rxjs/add/operator/startWith' |
4 | import { fromEvent } from 'rxjs/observable/fromEvent' | 7 | import { fromEvent } from 'rxjs/observable/fromEvent' |
5 | 8 | ||
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index d4f5e258f..01d32176b 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -29,6 +29,10 @@ export class VideoService { | |||
29 | private restService: RestService | 29 | private restService: RestService |
30 | ) {} | 30 | ) {} |
31 | 31 | ||
32 | getVideoViewUrl (uuid: string) { | ||
33 | return VideoService.BASE_VIDEO_URL + uuid + '/views' | ||
34 | } | ||
35 | |||
32 | getVideo (uuid: string): Observable<VideoDetails> { | 36 | getVideo (uuid: string): Observable<VideoDetails> { |
33 | return this.authHttp.get<VideoDetailsServerModel>(VideoService.BASE_VIDEO_URL + uuid) | 37 | return this.authHttp.get<VideoDetailsServerModel>(VideoService.BASE_VIDEO_URL + uuid) |
34 | .map(videoHash => new VideoDetails(videoHash)) | 38 | .map(videoHash => new VideoDetails(videoHash)) |
@@ -36,7 +40,7 @@ export class VideoService { | |||
36 | } | 40 | } |
37 | 41 | ||
38 | viewVideo (uuid: string): Observable<VideoDetails> { | 42 | viewVideo (uuid: string): Observable<VideoDetails> { |
39 | return this.authHttp.post(VideoService.BASE_VIDEO_URL + uuid + '/views', {}) | 43 | return this.authHttp.post(this.getVideoViewUrl(uuid), {}) |
40 | .map(this.restExtractor.extractDataBool) | 44 | .map(this.restExtractor.extractDataBool) |
41 | .catch(this.restExtractor.handleError) | 45 | .catch(this.restExtractor.handleError) |
42 | } | 46 | } |