+function viewportHeight () {
+ return Math.max(document.documentElement.clientHeight, window.innerHeight || 0)
+}
+
+function populateAsyncUserVideoChannels (authService: AuthService, channel: any[]) {
+ return new Promise(res => {
+ authService.userInformationLoaded
+ .subscribe(
+ () => {
+ const user = authService.getUser()
+ if (!user) return
+
+ const videoChannels = user.videoChannels
+ if (Array.isArray(videoChannels) === false) return
+
+ videoChannels.forEach(c => channel.push({ id: c.id, label: c.name }))
+
+ return res()
+ }
+ )
+ })
+}
+