Update page title and description on video change
This commit is contained in:
parent
dbd0a3bcac
commit
7ca4de2d98
|
@ -15,7 +15,8 @@ import {
|
||||||
Hotkey,
|
Hotkey,
|
||||||
HotkeysService,
|
HotkeysService,
|
||||||
User,
|
User,
|
||||||
UserService
|
UserService,
|
||||||
|
MetaService
|
||||||
} from '@app/core'
|
} from '@app/core'
|
||||||
import { HooksService } from '@app/core/plugins/hooks.service'
|
import { HooksService } from '@app/core/plugins/hooks.service'
|
||||||
import { isXPercentInViewport, scrollToTop, toBoolean } from '@app/helpers'
|
import { isXPercentInViewport, scrollToTop, toBoolean } from '@app/helpers'
|
||||||
|
@ -136,6 +137,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
private screenService: ScreenService,
|
private screenService: ScreenService,
|
||||||
private videoFileTokenService: VideoFileTokenService,
|
private videoFileTokenService: VideoFileTokenService,
|
||||||
private location: PlatformLocation,
|
private location: PlatformLocation,
|
||||||
|
private metaService: MetaService,
|
||||||
@Inject(LOCALE_ID) private localeId: string
|
@Inject(LOCALE_ID) private localeId: string
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
|
@ -460,6 +462,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.buildHotkeysHelp(video)
|
this.buildHotkeysHelp(video)
|
||||||
|
this.setMetaTags(video)
|
||||||
|
|
||||||
this.loadPlayer({ loggedInOrAnonymousUser, forceAutoplay })
|
this.loadPlayer({ loggedInOrAnonymousUser, forceAutoplay })
|
||||||
.catch(err => logger.error('Cannot build the player', err))
|
.catch(err => logger.error('Cannot build the player', err))
|
||||||
|
@ -913,6 +916,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
this.hotkeysService.add(this.hotkeys)
|
this.hotkeysService.add(this.hotkeys)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private setMetaTags (video: Video) {
|
||||||
|
this.metaService.setTitle(video.name)
|
||||||
|
|
||||||
|
this.metaService.setTag('description', video.description)
|
||||||
|
}
|
||||||
|
|
||||||
private getUrlOptions (): URLOptions {
|
private getUrlOptions (): URLOptions {
|
||||||
const queryParams = this.route.snapshot.queryParams
|
const queryParams = this.route.snapshot.queryParams
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue