export class VideoService {
static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos'
static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.'
+ static PODCAST_FEEDS_URL = environment.apiUrl + '/feeds/podcast/videos.xml'
static BASE_SUBSCRIPTION_FEEDS_URL = environment.apiUrl + '/feeds/subscriptions.'
constructor (
let params = this.restService.addRestGetParams(new HttpParams())
params = params.set('videoChannelId', videoChannelId.toString())
- return this.buildBaseFeedUrls(params)
+ const feedUrls = this.buildBaseFeedUrls(params)
+
+ feedUrls.push({
+ format: FeedFormat.RSS,
+ label: 'podcast rss 2.0',
+ url: VideoService.PODCAST_FEEDS_URL + `?videoChannelId=${videoChannelId}`
+ })
+
+ return feedUrls
}
getVideoSubscriptionFeedUrls (accountId: number, feedToken: string) {
: 'both'
}
+ // Choose if we display by default the account or the channel
+ buildDefaultOwnerDisplayType (video: Video) {
+ const accountName = video.account.name
+
+ // If the video channel name is an UUID (not really displayable, we changed this behaviour in v1.0.0-beta.12)
+ // Or has not been customized (default created channel display name)
+ // -> Use the account name
+ if (
+ video.channel.displayName === `Default ${accountName} channel` ||
+ video.channel.displayName === `Main ${accountName} channel` ||
+ video.channel.name.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/)
+ ) {
+ return 'account' as 'account'
+ }
+
+ return 'videoChannel' as 'videoChannel'
+ }
+
buildCommonVideosParams (options: CommonVideoParams & { params: HttpParams }) {
const {
params,