diff options
Diffstat (limited to 'client/src/app/videos/shared/video.service.ts')
-rw-r--r-- | client/src/app/videos/shared/video.service.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index 15f017e33..13d4ca246 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts | |||
@@ -24,6 +24,7 @@ export class VideoService { | |||
24 | 24 | ||
25 | videoCategories: Array<{ id: number, label: string }> = []; | 25 | videoCategories: Array<{ id: number, label: string }> = []; |
26 | videoLicences: Array<{ id: number, label: string }> = []; | 26 | videoLicences: Array<{ id: number, label: string }> = []; |
27 | videoLanguages: Array<{ id: number, label: string }> = []; | ||
27 | 28 | ||
28 | constructor( | 29 | constructor( |
29 | private authService: AuthService, | 30 | private authService: AuthService, |
@@ -59,6 +60,19 @@ export class VideoService { | |||
59 | }); | 60 | }); |
60 | } | 61 | } |
61 | 62 | ||
63 | loadVideoLanguages() { | ||
64 | return this.http.get(VideoService.BASE_VIDEO_URL + 'languages') | ||
65 | .map(this.restExtractor.extractDataGet) | ||
66 | .subscribe(data => { | ||
67 | Object.keys(data).forEach(languageKey => { | ||
68 | this.videoLanguages.push({ | ||
69 | id: parseInt(languageKey), | ||
70 | label: data[languageKey] | ||
71 | }); | ||
72 | }); | ||
73 | }); | ||
74 | } | ||
75 | |||
62 | getVideo(id: string): Observable<Video> { | 76 | getVideo(id: string): Observable<Video> { |
63 | return this.http.get(VideoService.BASE_VIDEO_URL + id) | 77 | return this.http.get(VideoService.BASE_VIDEO_URL + id) |
64 | .map(this.restExtractor.extractDataGet) | 78 | .map(this.restExtractor.extractDataGet) |