@latest-thinking/lt-player 1.0.5-l → 1.0.5-n

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.
@@ -9,6 +9,7 @@ export namespace LTPlayerShareEvents {
9
9
  activeModal(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, selectors: defaultType) {
10
10
  selectors.shareContainer.classList.remove('share-inactive');
11
11
  selectors.shareContainer.classList.add('share-active');
12
+ this.setCopyButtonsEvents(instance, selectors)
12
13
  if (instance.plyr.playing) {
13
14
  this.isPlaying = true;
14
15
  instance.plyr.pause();
@@ -31,13 +32,22 @@ export namespace LTPlayerShareEvents {
31
32
  instance.plyr.elements.container.querySelector('.poster-lt-player-share'),
32
33
  instance.plyr.elements.controls.querySelector('.lt-player-share'),
33
34
  ],
34
- shareContainer : instance.plyr.elements.container.querySelector('.share-controller-wrapper')
35
+ shareContainer : instance.plyr.elements.container.querySelector('.share-controller-wrapper'),
36
+ copyButtons : instance.plyr.elements.container.querySelectorAll('.share-controller-link')
35
37
  };
36
38
  }
37
39
 
38
- copyButtons(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
39
- return instance.plyr.elements.container.querySelectorAll('.share-controller-link');
40
+ setCopyButtonsEvents(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, selectors: defaultType) {
41
+ if (selectors.copyButtons.length > 0) {
42
+ selectors.copyButtons.forEach((button: HTMLElement) => {
43
+ button.addEventListener('click', function LTPlayerShareCopy() {
44
+ navigator.clipboard.writeText(button.dataset.copy);
45
+ })
46
+
47
+ })
48
+ }
40
49
  }
50
+
41
51
  }
42
52
  export class mobile {
43
53
  common : LTPlayerShareEvents.common
@@ -55,11 +55,13 @@ export class ResizeService {
55
55
  height: 150
56
56
  },
57
57
  size : {
58
- 1067 : "xl",
59
- 913 : "lg",
60
- 800 : "md",
61
- 760 : "sm",
62
- 266 : "xs"
58
+ 1067 : "xxl",
59
+ 913 : "xl",
60
+ 820 : "lg",
61
+ 760 : "md",
62
+ 640 : "sm",
63
+ 480 : "xs",
64
+ 266 : "xxs"
63
65
  }
64
66
  }
65
67
 
@@ -146,7 +148,9 @@ export class ResizeService {
146
148
  this.playerInstance.plyr.elements.container.insertAdjacentHTML("afterend", buttonsTemplate);
147
149
  let inserted = this.playerInstance.playerConfig.getPlayerElementContainer().querySelector('.lt-player__additional-info');
148
150
  inserted.classList.add('lt-player__additional-info__is_set_out-side');
149
- deskEvent.set(controller);
151
+ this.playerInstance.plyr.on('ready', () => {
152
+ deskEvent.set(controller);
153
+ })
150
154
  }
151
155
 
152
156
  const createAddInfoButtonsInSide = () => {
@@ -155,12 +159,29 @@ export class ResizeService {
155
159
  addInfoContainer.remove();
156
160
  }
157
161
 
158
- let controlsInfoBody = this.playerInstance.plyr.elements.controls.querySelector('.content__body');
162
+ if (this.playerInstance.plyr.elements.controls !== undefined) {
163
+ let controlsInfoBody = this.playerInstance.plyr.elements.controls.querySelector('.content__body');
164
+
165
+ controlsInfoBody.insertAdjacentHTML("afterend", buttonsTemplate);
166
+ let inserted = this.playerInstance.playerConfig.getPlayerElementContainer().querySelector('.lt-player__additional-info');
167
+ inserted.classList.add('lt-player__additional-info__is_set_in-side');
168
+
169
+ deskEvent.set(controller);
170
+ } else {
171
+ this.playerInstance.plyr.on('ready', () => {
172
+
173
+ let controlsInfoBody = this.playerInstance.plyr.elements.controls.querySelector('.content__body');
174
+
175
+ controlsInfoBody.insertAdjacentHTML("afterend", buttonsTemplate);
176
+ let inserted = this.playerInstance.playerConfig.getPlayerElementContainer().querySelector('.lt-player__additional-info');
177
+ inserted.classList.add('lt-player__additional-info__is_set_in-side');
178
+
179
+ deskEvent.set(controller);
180
+ })
181
+ }
182
+
183
+
159
184
 
160
- controlsInfoBody.insertAdjacentHTML("afterend", buttonsTemplate);
161
- let inserted = this.playerInstance.playerConfig.getPlayerElementContainer().querySelector('.lt-player__additional-info');
162
- inserted.classList.add('lt-player__additional-info__is_set_in-side');
163
- deskEvent.set(controller);
164
185
  }
165
186
 
166
187
  if (containerWidth >= 380) {
@@ -1,5 +1,30 @@
1
1
  {{#modal}}
2
2
  {{#mobile}}
3
+ {{#object_data}}
4
+ <div class="player-lt__mobile__modal-header">
5
+ <span class="line-button"></span>
6
+ </div>
7
+ <div class="player-lt__mobile__modal-content">
8
+ {{#abstract}}
9
+ <h2>{{abstract.title}}</h2>
10
+ <p>{{abstract.description}}</p>
11
+ <p>{{abstract.videoDOI}}</p>
12
+ <p>{{abstract.videoCitation}}</p>
13
+ {{/abstract}}
14
+
15
+ {{#institution}}
16
+ <h2>{{institution.title}}</h2>
17
+ <img src="{{institution.image}}" alt="image">
18
+ <p>{{institution.institutionName}}</p>
19
+ <p>{{institution.description}}</p>
20
+ {{/institution}}
21
+
22
+ {{#bio}}
23
+ <h2>{{bio.title}}</h2>
24
+ <p>{{bio.description}}</p>
25
+ {{/bio}}
26
+ </div>
27
+ {{/object_data}}
3
28
  {{#data}}
4
29
  <div class="player-lt__mobile__modal-header">
5
30
  <span class="line-button"></span>
@@ -10,6 +35,39 @@
10
35
  {{/data}}
11
36
  {{/mobile}}
12
37
  {{#desktop}}
38
+ {{#object_data}}
39
+ <div class="player-lt__modal lt-modal-{{id}}">
40
+ <div class="player-lt__modal-content">
41
+ <span class="player-lt__close-button">&times;</span>
42
+ <div class="player-lt__modal-body">
43
+ {{#abstract}}
44
+ <h2>{{abstract.title}}</h2>
45
+ <p>{{abstract.description}}</p>
46
+ <hr>
47
+ <h3>Video DOI</h3>
48
+ <p>{{abstract.videoDOI}}</p>
49
+ <h3>Video Citation</h3>
50
+ <p>{{abstract.videoCitation}}</p>
51
+ {{/abstract}}
52
+
53
+ {{#institution}}
54
+ <h2>{{institution.title}}</h2>
55
+ <div class="modal-flex">
56
+ <img src="{{institution.image}}" alt="image">
57
+ <h3>{{institution.institutionName}}</h3>
58
+ </div>
59
+ <hr>
60
+ <p>{{institution.description}}</p>
61
+ {{/institution}}
62
+
63
+ {{#bio}}
64
+ <h2>{{bio.title}}</h2>
65
+ <p>{{bio.description}}</p>
66
+ {{/bio}}
67
+ </div>
68
+ </div>
69
+ </div>
70
+ {{/object_data}}
13
71
  {{#data}}
14
72
  <div class="player-lt__modal lt-modal-{{id}}">
15
73
  <div class="player-lt__modal-content">