import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
import { NotificationsService } from 'angular2-notifications'
import { I18n } from '@ngx-translate/i18n-polyfill'
+import { VideoService } from '@app/shared/video/video.service'
+import { FeedFormat } from '../../../../../shared/models/feeds'
@Component({
selector: 'my-subscribe-button',
private router: Router,
private notificationsService: NotificationsService,
private userSubscriptionService: UserSubscriptionService,
- private i18n: I18n
+ private i18n: I18n,
+ private videoService: VideoService
) { }
get uri () {
if (this.isUserLoggedIn()) {
this.localSubscribe()
} else {
+ this.authService.redirectUrl = this.router.url
this.gotoLogin()
}
}
}
rssOpen () {
- window.open('')
+ const rssFeed = this.videoService
+ .getVideoChannelFeedUrls(this.videoChannel.id)
+ .find(i => i.format === FeedFormat.RSS)
+
+ window.open(rssFeed.url)
}
}