aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/shared/player-html.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/standalone/videos/shared/player-html.ts')
-rw-r--r--client/src/standalone/videos/shared/player-html.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/src/standalone/videos/shared/player-html.ts b/client/src/standalone/videos/shared/player-html.ts
index 110124417..eb6324ac7 100644
--- a/client/src/standalone/videos/shared/player-html.ts
+++ b/client/src/standalone/videos/shared/player-html.ts
@@ -6,6 +6,7 @@ export class PlayerHTML {
6 private readonly wrapperElement: HTMLElement 6 private readonly wrapperElement: HTMLElement
7 7
8 private playerElement: HTMLVideoElement 8 private playerElement: HTMLVideoElement
9 private informationElement: HTMLDivElement
9 10
10 constructor (private readonly videoWrapperId: string) { 11 constructor (private readonly videoWrapperId: string) {
11 this.wrapperElement = document.getElementById(this.videoWrapperId) 12 this.wrapperElement = document.getElementById(this.videoWrapperId)
@@ -66,6 +67,20 @@ export class PlayerHTML {
66 placeholder.style.display = 'none' 67 placeholder.style.display = 'none'
67 } 68 }
68 69
70 displayInformation (text: string, translations: Translations) {
71 if (this.informationElement) this.removeInformation()
72
73 this.informationElement = document.createElement('div')
74 this.informationElement.className = 'player-information'
75 this.informationElement.innerText = peertubeTranslate(text, translations)
76
77 document.body.appendChild(this.informationElement)
78 }
79
80 removeInformation () {
81 this.removeElement(this.informationElement)
82 }
83
69 private getPlaceholderElement () { 84 private getPlaceholderElement () {
70 return document.getElementById('placeholder-preview') 85 return document.getElementById('placeholder-preview')
71 } 86 }