@latest-thinking/lt-player 1.0.5-e → 1.0.5-g
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/dist/css/lt-player-main.css +1 -1
- package/dist/css/lt-player-main.css.map +1 -1
- package/dist/js/lt-player-main.js +1 -1
- package/dist/js/lt-player-main.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/sass/sections/_additional-info.scss +1 -1
- package/src/assets/sass/sections/controllers/_botom.scss +53 -53
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +35 -71
- package/src/assets/sass/sections/controllers/_top.scss +10 -8
- package/src/components/LTPlayerSetup.ts +1 -0
- package/src/components/LTPlayerType.ts +12 -25
- package/src/components/controls/LTPlayerControlsEvents.ts +1 -1
- package/src/components/events/LTPlayerCommon.ts +1 -1
- package/src/components/events/LTPlayerDesktop.ts +29 -1
- package/src/components/events/LTPlayerMobile.ts +29 -0
- package/src/components/poster/LTPlayerPoster.ts +36 -22
- package/src/components/poster/LTPlayerPosterEvents.ts +7 -7
- package/src/components/poster/LTPlayerPosterManager.ts +3 -10
- package/src/services/ResizeService.ts +1 -0
- package/src/views/controls.handlebars +6 -6
- package/src/views/poster.handlebars +2 -1
|
@@ -31,29 +31,43 @@ export class LTPlayerPoster {
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
setImage() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
const customImageSelector = this.plyr.elements.container.querySelector('.lt-player__poster__img--set-custom');
|
|
35
|
+
const defaultImageSelector = this.plyr.elements.container.querySelector('.lt-player__poster__img__set-default');
|
|
36
|
+
|
|
37
|
+
const checkImage = (imageUrl: string, callback: (arg0: boolean) => void) => {
|
|
38
|
+
let img = new Image();
|
|
39
|
+
|
|
40
|
+
img.onerror = function() {
|
|
41
|
+
callback(false);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
img.onload = function() {
|
|
45
|
+
callback(true);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
img.src = imageUrl;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
const setDefault = () => {
|
|
53
|
+
if (defaultImageSelector) {
|
|
54
|
+
defaultImageSelector.classList.remove('d-none');
|
|
50
55
|
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
56
|
+
}
|
|
53
57
|
|
|
54
|
-
removeDefaultImage() {
|
|
55
|
-
const posterImage: HTMLElement = this.plyr.elements.container.querySelector('.lt-player__poster__img');
|
|
56
|
-
posterImage.classList.add('d-none');
|
|
57
|
-
}
|
|
58
58
|
|
|
59
|
+
if (this.config.getPosterImage()) {
|
|
60
|
+
if (customImageSelector) {
|
|
61
|
+
checkImage(this.config.getPosterImage(), function (exist) {
|
|
62
|
+
if (!exist) {
|
|
63
|
+
setDefault();
|
|
64
|
+
} else {
|
|
65
|
+
customImageSelector.classList.remove('d-none');
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
setDefault()
|
|
71
|
+
}
|
|
72
|
+
}
|
|
59
73
|
}
|
|
@@ -128,13 +128,13 @@ export namespace LTPlayerPosterEvents {
|
|
|
128
128
|
* Remove Onload Poster from player
|
|
129
129
|
*/
|
|
130
130
|
onload(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
131
|
-
const playerElementContainer = instance.playerConfig.getPlayerElementContainer();
|
|
132
|
-
const playerOnloadPosterSelector = playerElementContainer.parentElement.querySelector('.lt-player-onload-poster');
|
|
133
|
-
|
|
134
|
-
if (playerOnloadPosterSelector) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
131
|
+
// const playerElementContainer = instance.playerConfig.getPlayerElementContainer();
|
|
132
|
+
// const playerOnloadPosterSelector = playerElementContainer.parentElement.querySelector('.lt-player-onload-poster');
|
|
133
|
+
//
|
|
134
|
+
// if (playerOnloadPosterSelector) {
|
|
135
|
+
// // playerElementContainer.classList.remove('d-none');
|
|
136
|
+
// playerElementContainer.parentElement.querySelector('.lt-player-onload-poster').remove();
|
|
137
|
+
// }
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
showControls(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
@@ -23,23 +23,16 @@ export class LTPlayerPosterManager {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
init(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
26
|
+
|
|
26
27
|
this.instance = instance;
|
|
27
28
|
this.playerConfig = instance.playerConfig;
|
|
28
29
|
this.templateService = instance.templateService;
|
|
29
30
|
this.iconService = instance.iconService;
|
|
30
31
|
|
|
31
32
|
this.poster = new LTPlayerPoster(this.instance.plyr, this.templateService, this.playerConfig, this.iconService);
|
|
32
|
-
this.poster.setTemplate();
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
result => {
|
|
37
|
-
this.poster.removeDefaultImage();
|
|
38
|
-
if (this.playerConfig.getPreload()) {
|
|
39
|
-
this.initPreload();
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
34
|
+
this.poster.setTemplate();
|
|
35
|
+
this.poster.setImage();
|
|
43
36
|
if (this.playerConfig.getPreload()) {
|
|
44
37
|
this.initPreload();
|
|
45
38
|
}
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
|
-
<div class="lt-player-notification">
|
|
34
|
+
<div class="lt-player-notification landscape">
|
|
35
35
|
<!-- <div class="lt-player-video-content">-->
|
|
36
36
|
<!-- <div class="content__body">-->
|
|
37
37
|
<!-- <h4 class="poster-title">{{videoParagraph}}</h4>-->
|
|
38
38
|
<!-- <p class="poster-paragraph">{{videoTitle}}</p>-->
|
|
39
39
|
<!-- </div>-->
|
|
40
40
|
<!-- </div>-->
|
|
41
|
-
<div class="lt-player-notification__notification-button-state">
|
|
41
|
+
<div class="lt-player-notification__notification-button-state landscape">
|
|
42
42
|
<div class="player-state">
|
|
43
43
|
<img class="player-state__icon filter" src="" alt="">
|
|
44
44
|
</div>
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
</div>
|
|
168
168
|
{{#mobile}}
|
|
169
169
|
<div class="plyr__controls__mobile-background d-none">
|
|
170
|
-
<div class="lt-player-notification">
|
|
170
|
+
<div class="lt-player-notification portrait">
|
|
171
171
|
<div class="lt-player-rewind-area">
|
|
172
172
|
</div>
|
|
173
173
|
<div class="lt-player-rewind lt-player-notify">
|
|
@@ -222,8 +222,8 @@
|
|
|
222
222
|
</div>
|
|
223
223
|
</div>
|
|
224
224
|
</div>
|
|
225
|
-
<div class="lt-player-notification">
|
|
226
|
-
<div class="lt-player-notification__notification-button-state">
|
|
225
|
+
<div class="lt-player-notification portrait">
|
|
226
|
+
<div class="lt-player-notification__notification-button-state portrait">
|
|
227
227
|
<div class="player-state">
|
|
228
228
|
<img class="player-state__icon filter" src="" alt="">
|
|
229
229
|
</div>
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
</div>
|
|
335
335
|
{{#mobile}}
|
|
336
336
|
<div class="plyr__controls__mobile-background d-none">
|
|
337
|
-
<div class="lt-player-notification">
|
|
337
|
+
<div class="lt-player-notification portrait">
|
|
338
338
|
<div class="lt-player-rewind-area">
|
|
339
339
|
</div>
|
|
340
340
|
<div class="lt-player-rewind lt-player-notify">
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<div class="lt-player__poster">
|
|
2
2
|
<div class="lt-player__poster__image-body lt-player__poster__background__grey" >
|
|
3
|
-
<img class="lt-player__poster__img lt-player__poster__img__set-default" alt="" src="{{logoBig}}">
|
|
3
|
+
<img class="lt-player__poster__img lt-player__poster__img__set-default d-none" alt="" src="{{logoBig}}">
|
|
4
|
+
<img class="lt-player__poster__img--set-custom d-none" alt="" src="{{config.configData.posterImage}}">
|
|
4
5
|
</div>
|
|
5
6
|
<div class="lt-player__poster__body">
|
|
6
7
|
<div class="content">
|