@latest-thinking/lt-player 1.0.7-c → 1.0.7-d

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latest-thinking/lt-player",
3
- "version": "1.0.7-c",
3
+ "version": "1.0.7-d",
4
4
  "description": "LT player.",
5
5
  "main": "dist/js/lt-player-main.js",
6
6
  "module": "dist/js/lt-player-main.js",
@@ -2,7 +2,7 @@ import {LTPLayerAddInfo} from "./LTPlayerAddInfoManager";
2
2
  import {additionalInformation} from "../../global/types/ModuleTypes";
3
3
 
4
4
  export class LTPlayerAddInfoDesktop {
5
- set(controller: LTPLayerAddInfo.Controller) {
5
+ set(controller: LTPLayerAddInfo.Controller, type: string) {
6
6
 
7
7
  const playerContainer = controller.plyr.elements.container;
8
8
  const playerControlsContainer = controller.plyr.elements.controls;
@@ -10,7 +10,6 @@ export class LTPlayerAddInfoDesktop {
10
10
  let additionalInfoBodyIn: Element = playerControlsContainer.querySelector('.lt-player__additional-info');
11
11
  let instance = controller;
12
12
 
13
-
14
13
  const getInfoButtons = (selector: Element): NodeList => {
15
14
 
16
15
  if (!selector) {
@@ -24,7 +23,7 @@ export class LTPlayerAddInfoDesktop {
24
23
  const infoButtonsOut: NodeList = getInfoButtons(additionalInfoBodyOut);
25
24
  const infoButtonsIn: NodeList = getInfoButtons(additionalInfoBodyIn);
26
25
 
27
- if (!infoButtonsOut) {
26
+ if (type == 'in') {
28
27
  buttons = infoButtonsIn;
29
28
  } else {
30
29
  buttons = infoButtonsOut;
@@ -91,9 +91,17 @@ export namespace LTPlayerPosterEvents {
91
91
  if (posterBody) {
92
92
  posterBody.addEventListener('click', function LTPlayerPosterButtons(event) {
93
93
  event.preventDefault();
94
+
95
+ if((event.target as HTMLInputElement).classList.contains('poster-lt-player-share') ||
96
+ (event.target as HTMLInputElement).classList.contains('filter')
97
+ ) {
98
+ return;
99
+ }
100
+
94
101
  instance.playerControl.desktopEvents.titleLineBreak(instance);
95
102
  instance.playerControl.desktopEvents.playPauseIcon(instance, 'timeupdate');
96
103
  common.poster.reset(instance);
104
+
97
105
  })
98
106
  }
99
107
  }
@@ -148,9 +148,7 @@ export class ResizeService {
148
148
  this.playerInstance.plyr.elements.container.insertAdjacentHTML("afterend", buttonsTemplate);
149
149
  let inserted = this.playerInstance.playerConfig.getPlayerElementContainer().querySelector('.lt-player__additional-info');
150
150
  inserted.classList.add('lt-player__additional-info__is_set_out-side');
151
- this.playerInstance.plyr.on('ready', () => {
152
- deskEvent.set(controller);
153
- })
151
+ deskEvent.set(controller, 'out');
154
152
  }
155
153
 
156
154
  const createAddInfoButtonsInSide = () => {
@@ -166,7 +164,7 @@ export class ResizeService {
166
164
  let inserted = this.playerInstance.playerConfig.getPlayerElementContainer().querySelector('.lt-player__additional-info');
167
165
  inserted.classList.add('lt-player__additional-info__is_set_in-side');
168
166
 
169
- deskEvent.set(controller);
167
+ deskEvent.set(controller, 'in');
170
168
  } else {
171
169
  this.playerInstance.plyr.on('ready', () => {
172
170
 
@@ -176,43 +174,39 @@ export class ResizeService {
176
174
  let inserted = this.playerInstance.playerConfig.getPlayerElementContainer().querySelector('.lt-player__additional-info');
177
175
  inserted.classList.add('lt-player__additional-info__is_set_in-side');
178
176
 
179
- deskEvent.set(controller);
177
+ deskEvent.set(controller, 'in');
180
178
  })
181
179
  }
182
-
183
-
184
-
185
180
  }
186
181
 
187
- if (containerWidth >= 380) {
188
-
189
- if (this.addInfoInSide && containerWidth + 70 <= 380) {
190
- return;
191
- }
182
+ if (containerWidth >= 380) {
192
183
 
193
- if (this.addInfoOutSide) {
194
- return;
195
- }
184
+ if (this.addInfoInSide && (containerWidth + 70 <= 380)) {
185
+ return;
186
+ }
196
187
 
197
- this.addInfoOutSide = true;
198
- this.addInfoInSide = false;
188
+ if (this.addInfoOutSide) {
189
+ return;
190
+ }
199
191
 
200
- createAddInfoButtonsOutSide();
201
- } else {
192
+ this.addInfoOutSide = true;
193
+ this.addInfoInSide = false;
202
194
 
203
- if (this.addInfoOutSide && containerWidth + 70 >= 380) {
204
- return;
205
- }
195
+ createAddInfoButtonsOutSide();
196
+ } else {
206
197
 
207
- if (this.addInfoInSide) {
208
- return;
209
- }
198
+ if (this.addInfoOutSide && (containerWidth + 70 >= 380)) {
199
+ return;
200
+ }
210
201
 
211
- this.addInfoInSide = true;
212
- this.addInfoOutSide = false;
213
- createAddInfoButtonsInSide();
214
- }
202
+ if (this.addInfoInSide) {
203
+ return;
204
+ }
215
205
 
206
+ this.addInfoInSide = true;
207
+ this.addInfoOutSide = false;
208
+ createAddInfoButtonsInSide();
209
+ }
216
210
  }
217
211
 
218
212
  protected setDimensions(containerWidth: number, containerHeight: number, defaultData: defaultType) {