]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-video-live/live-video.service.ts
Add ability to filter overall video stats by date
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-video-live / live-video.service.ts
index 11b9dd739e761f790088d691e6ae6d6f1c8c1a40..89bfd84a0130bf79a805222330af4b8ed1f70a80 100644 (file)
@@ -4,6 +4,7 @@ import { Injectable } from '@angular/core'
 import { RestExtractor } from '@app/core'
 import { LiveVideo, LiveVideoCreate, LiveVideoSession, LiveVideoUpdate, ResultList, VideoCreateResult } from '@shared/models'
 import { environment } from '../../../environments/environment'
+import { VideoService } from '../shared-main'
 
 @Injectable()
 export class LiveVideoService {
@@ -32,6 +33,12 @@ export class LiveVideoService {
                .pipe(catchError(err => this.restExtractor.handleError(err)))
   }
 
+  findLiveSessionFromVOD (videoId: number | string) {
+    return this.authHttp
+               .get<LiveVideoSession>(VideoService.BASE_VIDEO_URL + '/' + videoId + '/live-session')
+               .pipe(catchError(err => this.restExtractor.handleError(err)))
+  }
+
   updateLive (videoId: number | string, liveUpdate: LiveVideoUpdate) {
     return this.authHttp
       .put(LiveVideoService.BASE_VIDEO_LIVE_URL + videoId, liveUpdate)