@latest-thinking/lt-player 1.1.0-r → 1.1.0-t

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/ README.md +1 -0
  2. package/dist/css/lt-player-main.css +1 -1
  3. package/dist/css/lt-player-main.css.map +1 -1
  4. package/dist/js/lt-player-main.js +1 -1
  5. package/dist/js/lt-player-main.js.map +1 -1
  6. package/examples/lt-page-with-player.html +3529 -0
  7. package/examples/lt-page-with-player_files/Weiskopf_Coverphoto.jpg +0 -0
  8. package/examples/lt-page-with-player_files/ajax-progress.module.css +49 -0
  9. package/examples/lt-page-with-player_files/align.module.css +32 -0
  10. package/examples/lt-page-with-player_files/announce.js +49 -0
  11. package/examples/lt-page-with-player_files/autocomplete-loading.module.css +22 -0
  12. package/examples/lt-page-with-player_files/autocomplete.css +16 -0
  13. package/examples/lt-page-with-player_files/bootstrap.css +22691 -0
  14. package/examples/lt-page-with-player_files/clearfix.module.css +15 -0
  15. package/examples/lt-page-with-player_files/container-inline.module.css +16 -0
  16. package/examples/lt-page-with-player_files/cookiesjsr.min.css +10 -0
  17. package/examples/lt-page-with-player_files/core.css +97 -0
  18. package/examples/lt-page-with-player_files/details.module.css +10 -0
  19. package/examples/lt-page-with-player_files/fieldgroup.module.css +9 -0
  20. package/examples/lt-page-with-player_files/hidden.module.css +53 -0
  21. package/examples/lt-page-with-player_files/himme-alexander-beyond_0.jpg +0 -0
  22. package/examples/lt-page-with-player_files/item-list.module.css +19 -0
  23. package/examples/lt-page-with-player_files/js.module.css +22 -0
  24. package/examples/lt-page-with-player_files/latest_thinking.style.css +6496 -0
  25. package/examples/lt-page-with-player_files/logo-small.png +0 -0
  26. package/examples/lt-page-with-player_files/lt-player.css +3795 -0
  27. package/examples/lt-page-with-player_files/menu.css +64 -0
  28. package/examples/lt-page-with-player_files/nowrap.module.css +8 -0
  29. package/examples/lt-page-with-player_files/paragraphs.unpublished.css +3 -0
  30. package/examples/lt-page-with-player_files/position-container.module.css +8 -0
  31. package/examples/lt-page-with-player_files/progress.module.css +51 -0
  32. package/examples/lt-page-with-player_files/radix.style.css +1 -0
  33. package/examples/lt-page-with-player_files/reset-appearance.module.css +15 -0
  34. package/examples/lt-page-with-player_files/resize.module.css +21 -0
  35. package/examples/lt-page-with-player_files/search_api_autocomplete.css +41 -0
  36. package/examples/lt-page-with-player_files/sticky-header.module.css +13 -0
  37. package/examples/lt-page-with-player_files/system-status-counter.css +30 -0
  38. package/examples/lt-page-with-player_files/system-status-report-counters.css +27 -0
  39. package/examples/lt-page-with-player_files/system-status-report-general-info.css +14 -0
  40. package/examples/lt-page-with-player_files/tabledrag.module.css +98 -0
  41. package/examples/lt-page-with-player_files/tablesort.module.css +19 -0
  42. package/examples/lt-page-with-player_files/theme.css +446 -0
  43. package/examples/lt-page-with-player_files/thumbnail_MPI_CBS_Eingangsbereich.jpg +0 -0
  44. package/examples/lt-page-with-player_files/tree-child.module.css +18 -0
  45. package/examples/lt-page-with-player_files/widget-min.js +10 -0
  46. package/examples/lt-website.html +76 -0
  47. package/examples/portrait-with-subtitles.html +1 -0
  48. package/examples/samples/vtt/Sobolev-Anton-Subtitles-20230518_0.vtt +352 -0
  49. package/package.json +1 -1
  50. package/src/assets/sass/abstracts/_variables.scss +1 -1
  51. package/src/assets/sass/components/_all.scss +1 -1
  52. package/src/assets/sass/components/_loader.scss +70 -0
  53. package/src/assets/sass/core/_player.scss +3 -1
  54. package/src/assets/sass/sections/_additional-info.scss +1 -1
  55. package/src/assets/sass/sections/_settings.scss +1 -1
  56. package/src/assets/sass/sections/_subtitles.scss +50 -11
  57. package/src/assets/sass/sections/controllers/_botom.scss +43 -20
  58. package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +12 -1
  59. package/src/components/LTPlayerManager.ts +16 -0
  60. package/src/components/LTPlayerStatusFeedback.ts +68 -0
  61. package/src/components/LTPlayerUpdate.ts +3 -9
  62. package/src/components/captions/LTPlayerCaptions.ts +64 -0
  63. package/src/components/config/LTPlayerConfig.ts +10 -0
  64. package/src/components/config/LTPlayerConfigProcessor.ts +2 -1
  65. package/src/components/controls/LTPlayerChapters.ts +7 -3
  66. package/src/components/controls/LTPlayerControlsEvents.ts +63 -58
  67. package/src/components/controls/settings/LTPlayerCommonSettingsControllers.ts +7 -1
  68. package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +4 -5
  69. package/src/components/controls/settings/LTPlayerMobileSettingsControllers.ts +40 -44
  70. package/src/components/events/LTPlayerCommon.ts +46 -1
  71. package/src/components/events/LTPlayerDesktop.ts +8 -8
  72. package/src/components/events/LTPlayerMobile.ts +8 -11
  73. package/src/global/controllers/LTPlayerController.ts +7 -0
  74. package/src/services/Helper.ts +5 -1
  75. package/src/services/TemplateService.ts +5 -0
  76. package/src/views/settings.handlebars +1 -1
  77. package/src/views/settings.mobile.handlebars +20 -0
  78. package/src/views/template.handlebars +3 -0
  79. package/src/assets/sass/components/_spinner.scss +0 -46
@@ -2,7 +2,6 @@
2
2
 
3
3
  .lt-player-notification {
4
4
  width: 100%;
5
- padding: 20px 20px 28px 20px;
6
5
 
7
6
  &__notification-button-state {
8
7
  position: absolute;
@@ -228,6 +227,18 @@
228
227
  }
229
228
  }
230
229
 
230
+ .lt-player-orientation--portrait {
231
+ .lt-player-notification {
232
+ padding: 20px 20px 28px 20px;
233
+ }
234
+ }
235
+
236
+ .lt-player-orientation--landscape {
237
+ .lt-player-notification {
238
+ padding: 0;
239
+ }
240
+ }
241
+
231
242
  @container portrait (width > 319px) {
232
243
  .lt-player-orientation--portrait {
233
244
  .lt-player-notification {
@@ -202,6 +202,22 @@ export class LTPlayerManager {
202
202
  }
203
203
  }
204
204
 
205
+ getPlayerByExternalId(id: string | number): null | LTPlayer.LandscapeType | LTPlayer.PortraitType {
206
+ if (this.players.length === 0) {
207
+ return null;
208
+ }
209
+
210
+ let response = null;
211
+
212
+ this.players.forEach(instance => {
213
+ if (instance.playerConfig.getConfigData().externalId == id) {
214
+ response = instance;
215
+ }
216
+ })
217
+
218
+ return response;
219
+ }
220
+
205
221
  /**
206
222
  * Pause all players
207
223
  */
@@ -0,0 +1,68 @@
1
+ import {LTPlayerController} from "../global/controllers/LTPlayerController";
2
+
3
+ export class LTPlayerStatusFeedback {
4
+
5
+ player: LTPlayerController
6
+ element: HTMLElement
7
+
8
+ constructor(player: LTPlayerController) {
9
+ this.player = player;
10
+ }
11
+
12
+ private getElement(): HTMLElement {
13
+ if (!this.element) {
14
+ if (this.player.playerConfig) {
15
+ this.element = this.player.playerConfig.getPlayerElementContainer()
16
+ } else {
17
+ console.error("Failed to get element from playerConfig")
18
+ }
19
+ }
20
+ return this.element
21
+ }
22
+
23
+ private addClass(name: string) {
24
+ const element = this.getElement()
25
+ if (element && !element.classList.contains(name)) {
26
+ element.classList.add(name)
27
+ }
28
+ }
29
+
30
+ private removeClass(name: string) {
31
+ const element = this.getElement()
32
+ if (element && element.classList.contains(name)) {
33
+ element.classList.remove(name)
34
+ }
35
+ }
36
+
37
+ setLoading() {
38
+ this.addClass("lt-state-loader-active")
39
+ }
40
+
41
+ setLoadingSeek() {
42
+ this.addClass("lt-state-seeking")
43
+ this.setLoading()
44
+ }
45
+
46
+ clearLoading() {
47
+ this.removeClass("lt-state-loader-active")
48
+ this.removeClass("lt-state-seeking")
49
+ }
50
+
51
+ setFullscreen() {
52
+ this.addClass("lt-state-fullscreen")
53
+ }
54
+
55
+ clearFullscreen() {
56
+ this.removeClass("lt-state-fullscreen")
57
+ }
58
+
59
+ setControlsVisible() {
60
+ this.addClass("lt-state-controls-visible")
61
+ }
62
+
63
+ clearControlsVisible() {
64
+ this.removeClass("lt-state-controls-visible")
65
+ }
66
+
67
+ }
68
+
@@ -16,12 +16,7 @@ export class LTPlayerUpdate {
16
16
  this.updateVideo(config.body.videoUrl, config.body.posterImage);
17
17
  this.updateTitle(config.body.videoParagraph);
18
18
  this.updateAuthor(config.body.videoTitle);
19
- if (config.body.defaultConfig) {
20
- //you should check for subtitles, if there arent any, set the src of the track element to "" else take it from this config. I dont know what works and what doesnt.
21
- //Have fun, good luck.
22
- //Otherwise, im not really sure what happens
23
- this.updateSubtitles(config.body.defaultConfig.captions.url);
24
- }
19
+ this.updateSubtitles(config.body.defaultConfig?.captions.url ?? null);
25
20
  this.updateChapters(config);
26
21
  this.player.additionalInfoService.setConfig(config.body.additionalInfo);
27
22
  return;
@@ -60,8 +55,7 @@ export class LTPlayerUpdate {
60
55
  authorParagraph.textContent = author;
61
56
  }
62
57
 
63
- updateSubtitles(src: string) {
64
- const track = document.querySelector('track');
65
- console.log(track);
58
+ updateSubtitles(src: string|null) {
59
+ this.player.captionsService.setCaptions(src)
66
60
  }
67
61
  }
@@ -0,0 +1,64 @@
1
+ import {LTPlayerController} from "../../global/controllers/LTPlayerController";
2
+
3
+ export class LTPlayerCaptionsManager {
4
+ player: LTPlayerController
5
+
6
+ constructor(player: LTPlayerController) {
7
+ this.player = player;
8
+ }
9
+
10
+ setCaptions(src: string|null): void {
11
+ const playerContainer = this.player.playerConfig.getPlayerElementContainer()
12
+ const videoElement = playerContainer.querySelector("video")
13
+ const trackElement = videoElement.querySelector("track")
14
+
15
+ this.player.plyr.currentTrack = -1;
16
+ this.clearSubtitles()
17
+
18
+ if (trackElement) {
19
+ trackElement.remove()
20
+ }
21
+
22
+ if (src) {
23
+ const newTrack = document.createElement('track');
24
+ Object.assign(newTrack, {
25
+ kind: 'captions',
26
+ label: 'English captions',
27
+ srclang: 'en',
28
+ default: 'default',
29
+ src: src
30
+ });
31
+
32
+ newTrack.addEventListener(`load`, evt => {
33
+ this.player.plyr.currentTrack = 0;
34
+ });
35
+
36
+ this.player.plyr.toggleCaptions(true);
37
+ videoElement.appendChild(newTrack);
38
+ }
39
+ }
40
+
41
+ enableCaptions() {
42
+ this.player.playerConfig.setCaptionsEnabled(true)
43
+ this.player.plyr.currentTrack = 0;
44
+ this.player.plyr.toggleCaptions(true)
45
+ }
46
+
47
+ disableCaptions() {
48
+ this.player.playerConfig.setCaptionsEnabled(false)
49
+ this.player.plyr.currentTrack = -1;
50
+ this.player.plyr.toggleCaptions(false)
51
+ this.clearSubtitles()
52
+ }
53
+
54
+ clearSubtitles(): void {
55
+ const controls = this.player.plyr.elements.controls
56
+ const customSubtitlesElement = controls.querySelector('.lt-player-custom-captions');
57
+ const spanElement = customSubtitlesElement.querySelector('span');
58
+
59
+ if (!spanElement) {
60
+ return;
61
+ }
62
+ spanElement.innerHTML = ''; // Clear previous captions
63
+ }
64
+ }
@@ -18,6 +18,7 @@ export class LTPlayerConfig {
18
18
  videoParagraph: '',
19
19
  videoUrl : false,
20
20
  playerId: '',
21
+ externalId: '',
21
22
  playerContainer: '',
22
23
  vimeo: false,
23
24
  youtube: {
@@ -30,6 +31,7 @@ export class LTPlayerConfig {
30
31
  'playsinline': true,
31
32
  },
32
33
  defaultConfig : false,
34
+ captionsEnabled: false,
33
35
  share: null,
34
36
  chapters : null,
35
37
  playerType: null,
@@ -261,5 +263,13 @@ export class LTPlayerConfig {
261
263
  getEmbed() {
262
264
  return this.configData.embed;
263
265
  }
266
+
267
+ getCaptionsEnabled(): boolean {
268
+ return this.configData.captionsEnabled
269
+ }
270
+
271
+ setCaptionsEnabled(status: boolean) {
272
+ this.configData.captionsEnabled = status
273
+ }
264
274
  }
265
275
 
@@ -137,7 +137,8 @@ export namespace LTPlayerConfigProcessor {
137
137
  update: true
138
138
  },
139
139
  captions: {
140
- active: false
140
+ active: false,
141
+ update: true,
141
142
  },
142
143
  clickToPlay: false,
143
144
  playsinline: true,
@@ -191,13 +191,13 @@ export class LTPlayerChapters {
191
191
 
192
192
  leftButton.dataset.ltPlayerChaptertimestamp = String(false);
193
193
 
194
- if (left !== null) {
194
+ if (left !== null && left != undefined) {
195
195
  leftButton.dataset.ltPlayerChaptertimestamp = left.timestamp;
196
196
  }
197
197
 
198
198
  const rightButton: HTMLElement = playerControlsContainer.querySelector('.skip-forward');
199
199
 
200
- if (right !== null) {
200
+ if (right !== null && right != undefined) {
201
201
  rightButton.dataset.ltPlayerChaptertimestamp = right.timestamp;
202
202
  }
203
203
 
@@ -244,6 +244,10 @@ export class LTPlayerChapters {
244
244
  */
245
245
  findChapter(time: number, state: Array<any>) {
246
246
 
247
+ if (time == null || state.length == 0) {
248
+ return undefined;
249
+ }
250
+
247
251
  let current: null;
248
252
  let left: null;
249
253
  let right = null;
@@ -264,7 +268,7 @@ export class LTPlayerChapters {
264
268
  }
265
269
 
266
270
  for (let index = 0; index < state.length; index += 1) {
267
- let element = state[index];
271
+ const element = state[index];
268
272
  if (element.timestamp >= time) {
269
273
  right = element;
270
274
  current = findCurrent(state, index);
@@ -201,55 +201,54 @@ export namespace LTPlayerControlsEvents {
201
201
  }
202
202
  }
203
203
 
204
- showHideControls = {
205
- showHideText(visible: boolean, controls: HTMLElement) {
206
- const textControlsElement = controls.querySelector('.lt-player-video-content');
207
-
208
- if (textControlsElement) {
209
- if (visible) {
210
- if (!textControlsElement.classList.contains('lt-player-video-content-enable')) {
211
- textControlsElement.classList.add('lt-player-video-content-enable')
212
- }
213
- } else {
214
- textControlsElement.classList.remove('lt-player-video-content-enable')
204
+ showHideText(visible: boolean, controls: HTMLElement) {
205
+ const textControlsElement = controls.querySelector('.lt-player-video-content');
206
+
207
+ if (textControlsElement) {
208
+ if (visible) {
209
+ if (!textControlsElement.classList.contains('lt-player-video-content-enable')) {
210
+ textControlsElement.classList.add('lt-player-video-content-enable')
215
211
  }
212
+ } else {
213
+ textControlsElement.classList.remove('lt-player-video-content-enable')
216
214
  }
217
- },
215
+ }
216
+ }
218
217
 
219
- showHideSeekBar(visible: boolean, controls: HTMLElement) {
220
- const seekBarControlsElement = controls.querySelector('.plyr__progress--wrapper');
218
+ showHideSeekBar(visible: boolean, controls: HTMLElement) {
219
+ const seekBarControlsElement = controls.querySelector('.plyr__progress--wrapper');
221
220
 
222
- if (seekBarControlsElement) {
223
- if (visible) {
224
- if (!seekBarControlsElement.classList.contains('plyr__progress--wrapper-enable')) {
225
- seekBarControlsElement.classList.add('plyr__progress--wrapper-enable')
226
- }
227
- } else {
228
- seekBarControlsElement.classList.remove('plyr__progress--wrapper-enable')
221
+ if (seekBarControlsElement) {
222
+ if (visible) {
223
+ if (!seekBarControlsElement.classList.contains('plyr__progress--wrapper-enable')) {
224
+ seekBarControlsElement.classList.add('plyr__progress--wrapper-enable')
229
225
  }
226
+ } else {
227
+ seekBarControlsElement.classList.remove('plyr__progress--wrapper-enable')
230
228
  }
231
- },
229
+ }
230
+ }
232
231
 
233
- showHideBottomControls(visible: boolean, controls: HTMLElement) {
234
- const bottomControlsElement = controls.querySelector('.bottom-controller');
232
+ showHideBottomControls(visible: boolean, controls: HTMLElement) {
233
+ const bottomControlsElement = controls.querySelector('.bottom-controller');
235
234
 
236
- if (bottomControlsElement) {
237
- if (visible) {
238
- if (!bottomControlsElement.classList.contains('bottom-controller-enable')) {
239
- bottomControlsElement.classList.add('bottom-controller-enable')
240
- }
241
- } else {
242
- bottomControlsElement.classList.remove('bottom-controller-enable')
235
+ if (bottomControlsElement) {
236
+ if (visible) {
237
+ if (!bottomControlsElement.classList.contains('bottom-controller-enable')) {
238
+ bottomControlsElement.classList.add('bottom-controller-enable')
243
239
  }
240
+ } else {
241
+ bottomControlsElement.classList.remove('bottom-controller-enable')
244
242
  }
245
- },
246
-
247
- showHideOnPause(visible: boolean, controls: HTMLElement) {
248
- this.showHideBottomControls(visible, controls);
249
- this.showHideSeekBar(visible, controls);
250
- this.showHideBottomControls(visible, controls);
251
243
  }
252
244
  }
245
+
246
+ showHideAllControls(visible: boolean, controls: HTMLElement) {
247
+ this.showHideText(visible, controls);
248
+ this.showHideSeekBar(visible, controls);
249
+ this.showHideBottomControls(visible, controls);
250
+ }
251
+
253
252
  }
254
253
 
255
254
  export class Desktop {
@@ -272,11 +271,11 @@ export namespace LTPlayerControlsEvents {
272
271
  const controls = instance.plyr.elements.controls;
273
272
  const commonInstance = this.common;
274
273
  controls.classList.add('plyr__controls-enable');
274
+ instance.statusFeedbackService.setControlsVisible()
275
275
 
276
-
277
- commonInstance.showHideControls.showHideText(true, controls);
278
- commonInstance.showHideControls.showHideSeekBar(true, controls);
279
- commonInstance.showHideControls.showHideBottomControls(true, controls);
276
+ commonInstance.showHideText(true, controls);
277
+ commonInstance.showHideSeekBar(true, controls);
278
+ commonInstance.showHideBottomControls(true, controls);
280
279
 
281
280
  let timerText: NodeJS.Timeout = null;
282
281
  let timerSeekBar: NodeJS.Timeout = null;
@@ -297,20 +296,20 @@ export namespace LTPlayerControlsEvents {
297
296
  }
298
297
 
299
298
  if (instance.plyr.paused) {
300
- commonInstance.showHideControls.showHideOnPause(true, controls);
299
+ commonInstance.showHideAllControls(true, controls);
301
300
  return;
302
301
  }
303
302
 
304
303
  if (!instance.playerConfig.isPinTextControls()) {
305
- commonInstance.showHideControls.showHideText(true, controls);
304
+ commonInstance.showHideText(true, controls);
306
305
  }
307
306
 
308
307
  if (!instance.playerConfig.isPinSeekBarControls()) {
309
- commonInstance.showHideControls.showHideSeekBar(true, controls);
308
+ commonInstance.showHideSeekBar(true, controls);
310
309
  }
311
310
 
312
311
  if (!instance.playerConfig.isPinBottomControls()) {
313
- commonInstance.showHideControls.showHideBottomControls(true, controls);
312
+ commonInstance.showHideBottomControls(true, controls);
314
313
  }
315
314
 
316
315
  })
@@ -318,25 +317,26 @@ export namespace LTPlayerControlsEvents {
318
317
 
319
318
  controls.addEventListener('mouseleave', function () {
320
319
  if (instance.plyr.paused) {
321
- commonInstance.showHideControls.showHideOnPause(true, controls);
320
+ commonInstance.showHideAllControls(true, controls);
322
321
  return;
323
322
  }
324
323
 
325
324
  if (!instance.playerConfig.isPinTextControls()) {
326
325
  timerText = setTimeout(() => {
327
- commonInstance.showHideControls.showHideText(false, controls);
326
+ commonInstance.showHideText(false, controls);
328
327
  }, 5000)
329
328
  }
330
329
 
331
330
  if (!instance.playerConfig.isPinSeekBarControls()) {
332
331
  timerSeekBar = setTimeout(() => {
333
- commonInstance.showHideControls.showHideSeekBar(false, controls);
332
+ commonInstance.showHideSeekBar(false, controls);
334
333
 
335
334
  }, 5000)
336
335
  }
337
336
  if (!instance.playerConfig.isPinBottomControls()) {
338
337
  timerBottomControls = setTimeout(() => {
339
- commonInstance.showHideControls.showHideBottomControls(false, controls);
338
+ instance.statusFeedbackService.clearControlsVisible()
339
+ commonInstance.showHideBottomControls(false, controls);
340
340
  }, 5000)
341
341
  }
342
342
  })
@@ -668,6 +668,8 @@ export namespace LTPlayerControlsEvents {
668
668
 
669
669
  let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
670
670
 
671
+ instance.statusFeedbackService.setControlsVisible()
672
+
671
673
  if (playerContainer.classList.contains('plyr--hide-controls')) {
672
674
  playerContainer.classList.remove('plyr--hide-controls');
673
675
  }
@@ -688,13 +690,13 @@ export namespace LTPlayerControlsEvents {
688
690
  clearTimeout(this.controlsTimeOut);
689
691
  }
690
692
 
691
- commonInstance.showHideControls.showHideText(true, playerControlsContainer);
692
- commonInstance.showHideControls.showHideSeekBar(true, playerControlsContainer);
693
- commonInstance.showHideControls.showHideBottomControls(true, playerControlsContainer);
693
+ commonInstance.showHideText(true, playerControlsContainer);
694
+ commonInstance.showHideSeekBar(true, playerControlsContainer);
695
+ commonInstance.showHideBottomControls(true, playerControlsContainer);
694
696
 
695
697
 
696
698
  if (instance.plyr.paused) {
697
- commonInstance.showHideControls.showHideOnPause(true, playerControlsContainer);
699
+ commonInstance.showHideAllControls(true, playerControlsContainer);
698
700
  return;
699
701
  }
700
702
 
@@ -709,24 +711,27 @@ export namespace LTPlayerControlsEvents {
709
711
  let playerControlsBackground = playerContainer.querySelector('.plyr__controls__mobile-background');
710
712
 
711
713
  const showHideControls = () => {
714
+ instance.statusFeedbackService.clearControlsVisible()
715
+
712
716
  if (!instance.playerConfig.isPinTextControls()) {
713
- commonInstance.showHideControls.showHideText(false, playerControlsContainer);
717
+ commonInstance.showHideText(false, playerControlsContainer);
714
718
  }
715
719
 
716
720
  if (!instance.playerConfig.isPinSeekBarControls()) {
717
- commonInstance.showHideControls.showHideSeekBar(false, playerControlsContainer);
721
+ commonInstance.showHideSeekBar(false, playerControlsContainer);
718
722
  }
719
723
  if (!instance.playerConfig.isPinBottomControls()) {
720
- commonInstance.showHideControls.showHideBottomControls(false, playerControlsContainer);
724
+ commonInstance.showHideBottomControls(false, playerControlsContainer);
721
725
  }
722
726
  }
723
727
 
728
+
724
729
  if (!playerControlsContainer.classList.contains('plyr__controls-enable-addInfo')) {
725
730
 
726
731
  if (now) {
727
732
 
728
733
  if (instance.plyr.paused) {
729
- commonInstance.showHideControls.showHideOnPause(true, playerControlsContainer);
734
+ commonInstance.showHideAllControls(true, playerControlsContainer);
730
735
  return;
731
736
  }
732
737
 
@@ -742,7 +747,7 @@ export namespace LTPlayerControlsEvents {
742
747
  // playerContainer.classList.add('plyr--hide-controls');
743
748
 
744
749
  if (instance.plyr.paused) {
745
- commonInstance.showHideControls.showHideOnPause(true, playerControlsContainer);
750
+ commonInstance.showHideAllControls(true, playerControlsContainer);
746
751
  return;
747
752
  }
748
753
 
@@ -9,7 +9,13 @@ export class LTPlayerCommonSettingsControllers {
9
9
  }
10
10
 
11
11
  addSettingsTemplate(string: 'mobile' | 'desktop') {
12
- const settingsTemplate = this.instance.templateService.getSettings({id : this.instance.playerConfig.getPlayerId(), [string] : true});
12
+ const settingsTemplate = this.instance.templateService.getSettings(
13
+ {
14
+ id : this.instance.playerConfig.getPlayerId(),
15
+ [string] : true,
16
+ captions_enabled: this.instance.playerConfig.getCaptionsEnabled()
17
+ }
18
+ );
13
19
  const lastElement = this.instance.plyr.elements.controls.lastElementChild;
14
20
 
15
21
  if (lastElement) {
@@ -33,18 +33,17 @@ export class LTPlayerDesktopSettingsControllers implements SettingsControlsInter
33
33
 
34
34
  const selectors = this.settingsInstance.common.getSelectors();
35
35
 
36
- const checkBox = selectors.playerControlsContainer.querySelector(`#captions-lt-player-${this.settingsInstance.playerInstance.playerConfig.getPlayerId()}`) as HTMLInputElement;
36
+ const checkBox = selectors.playerControlsContainer.querySelector(`.subtitles-body__input-switch`) as HTMLInputElement;
37
37
 
38
38
  if (checkBox) {
39
39
  checkBox.addEventListener('change', () => {
40
40
 
41
41
  if (!checkBox.checked) {
42
- this.settingsInstance.player.toggleCaptions(false);
43
- return
42
+ this.settingsInstance.playerInstance.captionsService.disableCaptions();
43
+ } else {
44
+ this.settingsInstance.playerInstance.captionsService.enableCaptions();
44
45
  }
45
46
 
46
- this.settingsInstance.player.toggleCaptions(true);
47
-
48
47
  })
49
48
  }
50
49
  }