import { catchError, map, switchMap } from 'rxjs/operators'
import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http'
import { Injectable } from '@angular/core'
-import { ComponentPaginationLight, RestExtractor, RestService, ServerService, UserService } from '@app/core'
+import { ComponentPaginationLight, RestExtractor, RestService, ServerService, UserService, AuthService } from '@app/core'
import { objectToFormData } from '@app/helpers'
import {
FeedFormat,
private authHttp: HttpClient,
private restExtractor: RestExtractor,
private restService: RestService,
- private serverService: ServerService
+ private serverService: ServerService,
+ private authService: AuthService
) {}
getVideoViewUrl (uuid: string) {
return this.buildBaseFeedUrls(params)
}
+ async getVideoSubscriptionFeedUrls (accountId: number) {
+ let params = this.restService.addRestGetParams(new HttpParams())
+ params = params.set('accountId', accountId.toString())
+
+ const { feedToken } = await this.authService.getScopedTokens()
+ params = params.set('token', feedToken)
+
+ return this.buildBaseFeedUrls(params)
+ }
+
getVideoFileMetadata (metadataUrl: string) {
return this.authHttp
.get<VideoFileMetadata>(metadataUrl)