From d07137b90b2b2b0c1e93a6f0e7bf8719b133027c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Mar 2017 21:11:37 +0200 Subject: Client: add support for video licences --- client/src/app/videos/shared/video.service.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'client/src/app/videos/shared/video.service.ts') diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index debc114aa..15f017e33 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts @@ -23,6 +23,7 @@ export class VideoService { private static BASE_VIDEO_URL = '/api/v1/videos/'; videoCategories: Array<{ id: number, label: string }> = []; + videoLicences: Array<{ id: number, label: string }> = []; constructor( private authService: AuthService, @@ -45,6 +46,19 @@ export class VideoService { }); } + loadVideoLicences() { + return this.http.get(VideoService.BASE_VIDEO_URL + 'licences') + .map(this.restExtractor.extractDataGet) + .subscribe(data => { + Object.keys(data).forEach(licenceKey => { + this.videoLicences.push({ + id: parseInt(licenceKey), + label: data[licenceKey] + }); + }); + }); + } + getVideo(id: string): Observable