@latest-thinking/lt-player 1.0.3-c → 1.0.4-c
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 +5 -0
- package/dist/css/lt-player-main.css.map +1 -0
- package/dist/js/lt-player-main.js +3 -0
- package/dist/js/lt-player-main.js.map +1 -0
- package/package.json +5 -5
- package/src/assets/sass/abstracts/_mixins.scss +7 -0
- package/src/assets/sass/core/_fonts.scss +5 -5
- package/src/assets/sass/sections/_share.scss +3 -4
- package/src/assets/sass/sections/_subtitles.scss +6 -0
- package/src/assets/sass/sections/controllers/_botom.scss +14 -4
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +60 -15
- package/src/assets/sass/sections/controllers/_top.scss +18 -1
- package/src/components/LTPlayerManager.ts +2 -6
- package/src/components/LTPlayerType.ts +9 -3
- package/src/components/controls/LTPlayerControlsEvents.ts +25 -164
- package/src/components/events/LTPlayerCommon.ts +4 -1
- package/src/components/events/LTPlayerDesktop.ts +20 -5
- package/src/components/events/LTPlayerMobile.ts +21 -11
- package/src/components/poster/LTPlayerPoster.ts +4 -13
- package/src/components/share/LTPlayerShare.ts +40 -0
- package/src/components/share/LTPlayerShareEvents.ts +103 -0
- package/src/global/controllers/LTPlayerController.ts +3 -1
- package/src/global/types/ModuleTypes.d.ts +6 -0
- package/src/index.ts +1 -3
- package/src/services/IconsService.ts +2 -1
- package/src/views/controls.handlebars +33 -12
- package/src/views/poster.handlebars +5 -7
- package/dist/css/lt-player-app.css +0 -5
- package/dist/css/lt-player-app.css.map +0 -1
- package/dist/js/lt-player-app.js +0 -3
- package/dist/js/lt-player-app.js.map +0 -1
- package/webpack.common.js +0 -49
- package/webpack.config.dev.js +0 -50
- package/webpack.config.prod.js +0 -43
- /package/dist/js/{lt-player-app.js.LICENSE.txt → lt-player-main.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latest-thinking/lt-player",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4-c",
|
|
4
4
|
"description": "LT player.",
|
|
5
|
-
"main": "dist/js/lt-player-
|
|
6
|
-
"module": "dist/js/lt-player-
|
|
7
|
-
"sass": "
|
|
8
|
-
"style": "dist/css/lt-player-
|
|
5
|
+
"main": "dist/js/lt-player-main.js",
|
|
6
|
+
"module": "dist/js/lt-player-main.js",
|
|
7
|
+
"sass": "src/assets/sass/app.scss",
|
|
8
|
+
"style": "dist/css/lt-player-main.css",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"lint": "npm run lint:styles; npm run lint:scripts",
|
|
11
11
|
"lint:styles": "stylelint src",
|
|
@@ -22,31 +22,31 @@
|
|
|
22
22
|
|
|
23
23
|
@font-face {
|
|
24
24
|
font-family: "MuseoSans";
|
|
25
|
-
src: url('
|
|
25
|
+
src: url('/src/assets/fonts/museo/MuseoSans-100.otf') format('opentype');
|
|
26
26
|
font-weight: 100;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@font-face {
|
|
30
30
|
font-family: "MuseoSans";
|
|
31
|
-
src: url('
|
|
31
|
+
src: url('/src/assets/fonts/museo/MuseoSans-300.otf') format('opentype');
|
|
32
32
|
font-weight: 300;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@font-face {
|
|
36
36
|
font-family: "MuseoSans";
|
|
37
|
-
src: url('
|
|
37
|
+
src: url('/src/assets/fonts/museo/MuseoSans-500.otf') format('opentype');
|
|
38
38
|
font-weight: 500;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
@font-face {
|
|
42
42
|
font-family: "MuseoSans";
|
|
43
|
-
src: url('
|
|
43
|
+
src: url('/src/assets/fonts/museo/MuseoSans-700.otf') format('opentype');
|
|
44
44
|
font-weight: 700;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
@font-face {
|
|
48
48
|
font-family: "MuseoSans";
|
|
49
|
-
src: url('
|
|
49
|
+
src: url('/src/assets/fonts/museo/MuseoSans-900.otf') format('opentype');
|
|
50
50
|
font-weight: 900;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.plyr {
|
|
2
|
-
&__controls {
|
|
3
2
|
.share-controller {
|
|
4
3
|
|
|
5
4
|
.share-inactive {
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
position: absolute;
|
|
20
19
|
right: 0;
|
|
21
20
|
top: 0;
|
|
22
|
-
z-index:
|
|
21
|
+
z-index: 99;
|
|
23
22
|
|
|
24
23
|
.share-controller-content {
|
|
25
24
|
background: #fff;
|
|
@@ -95,7 +94,7 @@
|
|
|
95
94
|
|
|
96
95
|
.share-icon__icon {
|
|
97
96
|
border-radius: 50%;
|
|
98
|
-
box-shadow:
|
|
97
|
+
box-shadow: 0 4px 20px rgba(0,0,0,.1);
|
|
99
98
|
display: block;
|
|
100
99
|
margin-bottom: 5px;
|
|
101
100
|
max-height: 35px;
|
|
@@ -119,5 +118,5 @@
|
|
|
119
118
|
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
|
-
|
|
121
|
+
|
|
123
122
|
}
|
|
@@ -4,4 +4,10 @@
|
|
|
4
4
|
margin: auto!important;
|
|
5
5
|
width: 75%;
|
|
6
6
|
color: $default-lt-player-white !important;
|
|
7
|
+
background-color: $default-lt-player-black !important;
|
|
8
|
+
font-size: $lt-player-font-size-lg !important;
|
|
9
|
+
line-height: $lt-player-line-height !important;
|
|
10
|
+
padding: .5rem .75rem !important;
|
|
11
|
+
font-family: $lt-font-family-base !important;
|
|
12
|
+
white-space: unset !important;
|
|
7
13
|
}
|
|
@@ -175,6 +175,10 @@
|
|
|
175
175
|
&__right-buttons {
|
|
176
176
|
direction: unset;
|
|
177
177
|
}
|
|
178
|
+
|
|
179
|
+
&__play-button_body {
|
|
180
|
+
bottom: -3px;
|
|
181
|
+
}
|
|
178
182
|
}
|
|
179
183
|
}
|
|
180
184
|
}
|
|
@@ -245,8 +249,14 @@
|
|
|
245
249
|
width: 44px;
|
|
246
250
|
height: 40px;
|
|
247
251
|
white-space: nowrap;
|
|
248
|
-
font-size:
|
|
252
|
+
font-size: 12px;
|
|
249
253
|
transition: none;
|
|
254
|
+
background-color: $default-lt-player-blue;
|
|
255
|
+
|
|
256
|
+
&:focus,
|
|
257
|
+
&:active {
|
|
258
|
+
background-color: $default-lt-player-blue;
|
|
259
|
+
}
|
|
250
260
|
}
|
|
251
261
|
|
|
252
262
|
&__background {
|
|
@@ -258,14 +268,14 @@
|
|
|
258
268
|
background: var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));
|
|
259
269
|
}
|
|
260
270
|
|
|
261
|
-
&__play-button_body{
|
|
262
|
-
bottom: -
|
|
271
|
+
&__play-button_body {
|
|
272
|
+
bottom: -8px;
|
|
263
273
|
position: relative;
|
|
264
274
|
|
|
265
275
|
.play-button {
|
|
266
276
|
@extend %lt-player-btn;
|
|
267
277
|
@include yellow-btn;
|
|
268
|
-
padding:
|
|
278
|
+
padding: 1rem;
|
|
269
279
|
}
|
|
270
280
|
}
|
|
271
281
|
|
|
@@ -36,6 +36,27 @@
|
|
|
36
36
|
display: flex;
|
|
37
37
|
position: relative;
|
|
38
38
|
|
|
39
|
+
&__notification-button-state {
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 40%;
|
|
42
|
+
left: 50%;
|
|
43
|
+
transform: translate(-50%, -50%);
|
|
44
|
+
|
|
45
|
+
.player-state {
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition: all 0.3s ease-in-out;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
@extend %lt-player-btn;
|
|
50
|
+
@include dark-btn;
|
|
51
|
+
background: rgba(39, 40, 42, 0.5);
|
|
52
|
+
padding: 1rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.active {
|
|
56
|
+
opacity: 1;
|
|
57
|
+
transition: all 0.3s ease-in-out;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
39
60
|
|
|
40
61
|
.lt-player-video-content {
|
|
41
62
|
position: absolute;
|
|
@@ -86,19 +107,32 @@
|
|
|
86
107
|
left: 0;
|
|
87
108
|
top: 0;
|
|
88
109
|
|
|
110
|
+
&__icon-wrapper {
|
|
111
|
+
display: flex;
|
|
112
|
+
padding: 0 .5rem;
|
|
113
|
+
user-select: none;
|
|
114
|
+
|
|
115
|
+
&.rotate {
|
|
116
|
+
rotate: 180deg;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
img {
|
|
120
|
+
max-width: 20px;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
89
124
|
&__icon {
|
|
125
|
+
display: flex;
|
|
90
126
|
justify-content:flex-start;
|
|
91
127
|
align-items:center;
|
|
92
128
|
margin: auto;
|
|
93
129
|
color: rgba(255,255,255, 1);
|
|
94
|
-
|
|
95
|
-
color: white;
|
|
96
|
-
}
|
|
97
|
-
|
|
130
|
+
user-select: none;
|
|
98
131
|
}
|
|
99
132
|
|
|
100
|
-
span{
|
|
101
|
-
font-size:12px;
|
|
133
|
+
span {
|
|
134
|
+
font-size: 12px;
|
|
135
|
+
user-select: none;
|
|
102
136
|
}
|
|
103
137
|
|
|
104
138
|
}
|
|
@@ -120,15 +154,25 @@
|
|
|
120
154
|
right: 0;
|
|
121
155
|
top: 0;
|
|
122
156
|
|
|
157
|
+
&__icon-wrapper {
|
|
158
|
+
display: flex;
|
|
159
|
+
padding: 0 .5rem;
|
|
160
|
+
|
|
161
|
+
&.rotate {
|
|
162
|
+
rotate: 180deg;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
img {
|
|
166
|
+
max-width: 20px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
123
170
|
&__icon {
|
|
171
|
+
display: flex;
|
|
124
172
|
justify-content:flex-start;
|
|
125
173
|
align-items:center;
|
|
126
174
|
margin: auto;
|
|
127
175
|
color: rgba(255,255,255, 1);
|
|
128
|
-
|
|
129
|
-
i {
|
|
130
|
-
color: white;
|
|
131
|
-
}
|
|
132
176
|
}
|
|
133
177
|
|
|
134
178
|
span{
|
|
@@ -140,8 +184,9 @@
|
|
|
140
184
|
|
|
141
185
|
.lt-player-notify {
|
|
142
186
|
transition: background 0.8s;
|
|
143
|
-
background: rgba(200,200,200,.4) radial-gradient(circle, transparent 1%, rgba(200,200,200,.4) 1%) center/15000%;
|
|
187
|
+
//background: rgba(200,200,200,.4) radial-gradient(circle, transparent 1%, rgba(200,200,200,.4) 1%) center/15000%;
|
|
144
188
|
opacity: 0;
|
|
189
|
+
//opacity: 1;
|
|
145
190
|
}
|
|
146
191
|
|
|
147
192
|
|
|
@@ -168,14 +213,14 @@
|
|
|
168
213
|
|
|
169
214
|
@keyframes ripple{
|
|
170
215
|
0% {
|
|
171
|
-
background-color: rgba(200,200,200,.4);
|
|
172
|
-
background-size: 100%;
|
|
216
|
+
//background-color: rgba(200,200,200,.4);
|
|
217
|
+
//background-size: 100%;
|
|
173
218
|
transition: background 0s;
|
|
174
219
|
opacity:1;
|
|
175
220
|
}
|
|
176
221
|
100% {
|
|
177
|
-
transition: background 6s;
|
|
178
|
-
background: rgba(200,200,200,.4) radial-gradient(circle, transparent 1%, rgba(200,200,200,.4) 1%) center/15000%;
|
|
222
|
+
//transition: background 6s;
|
|
223
|
+
//background: rgba(200,200,200,.4) radial-gradient(circle, transparent 1%, rgba(200,200,200,.4) 1%) center/15000%;
|
|
179
224
|
display: flex;
|
|
180
225
|
opacity:0;
|
|
181
226
|
}
|
|
@@ -66,6 +66,24 @@
|
|
|
66
66
|
display: flex;
|
|
67
67
|
justify-content: space-between;
|
|
68
68
|
|
|
69
|
+
&__left {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
align-items: start;
|
|
73
|
+
flex: 0 0 20%
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&__center {
|
|
77
|
+
flex: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__right {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
align-items: end;
|
|
84
|
+
flex: 0 0 20%
|
|
85
|
+
}
|
|
86
|
+
|
|
69
87
|
&__center {
|
|
70
88
|
width: 100%;
|
|
71
89
|
word-break: break-word;
|
|
@@ -81,7 +99,6 @@
|
|
|
81
99
|
}
|
|
82
100
|
|
|
83
101
|
&__right {
|
|
84
|
-
//display: grid;
|
|
85
102
|
|
|
86
103
|
.mini-player-control {
|
|
87
104
|
margin-top: 1rem;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {ValidatorService} from "../services/ValidatorService";
|
|
3
|
-
import {defaultType, playerConfigType, playerManger, PlayerType} from "../global/types/ModuleTypes";
|
|
1
|
+
import {playerConfigType, playerManger} from "../global/types/ModuleTypes";
|
|
4
2
|
import {LTPlayer} from "./LTPlayerType"
|
|
5
|
-
import {LTPLayerAddInfo} from "./addInfo/LTPlayerAddInfoManager";
|
|
6
|
-
import {Helper} from "../services/Helper";
|
|
7
3
|
import {LTPlayerSetup} from "./LTPlayerSetup";
|
|
8
|
-
|
|
9
4
|
export class LTPlayerManager {
|
|
10
5
|
|
|
11
6
|
/**
|
|
@@ -19,6 +14,7 @@ export class LTPlayerManager {
|
|
|
19
14
|
*
|
|
20
15
|
*/
|
|
21
16
|
constructor() {
|
|
17
|
+
this.initPageDomElements();
|
|
22
18
|
}
|
|
23
19
|
|
|
24
20
|
/**
|
|
@@ -139,6 +139,10 @@ export namespace LTPlayer {
|
|
|
139
139
|
|
|
140
140
|
this.posterManager.init(this);
|
|
141
141
|
|
|
142
|
+
if (this.playerConfig.getShareData()) {
|
|
143
|
+
this.share.init(this);
|
|
144
|
+
}
|
|
145
|
+
|
|
142
146
|
if (this.playerConfig.getDevice() !== 'mobile') {
|
|
143
147
|
this.miniPlayer.init(player, this.templateService, this.iconService);
|
|
144
148
|
}
|
|
@@ -163,7 +167,7 @@ export namespace LTPlayer {
|
|
|
163
167
|
destruct() {
|
|
164
168
|
let _this = this;
|
|
165
169
|
|
|
166
|
-
return new Promise((resolve
|
|
170
|
+
return new Promise((resolve) => {
|
|
167
171
|
_this.additionalInfoService.remove(this);
|
|
168
172
|
|
|
169
173
|
_this.additionalInfoService = null;
|
|
@@ -252,10 +256,12 @@ export namespace LTPlayer {
|
|
|
252
256
|
|
|
253
257
|
this.devMethodePlayer = new LTPlayerDevMethode.Player(player);
|
|
254
258
|
|
|
255
|
-
this.posterManager = new LTPlayerPosterManager();
|
|
256
|
-
|
|
257
259
|
this.posterManager.init(this);
|
|
258
260
|
|
|
261
|
+
if (this.playerConfig.getShareData()) {
|
|
262
|
+
this.share.init(this);
|
|
263
|
+
}
|
|
264
|
+
|
|
259
265
|
if (this.playerConfig.getDevice() !== 'mobile') {
|
|
260
266
|
this.miniPlayer.init(player, this.templateService, this.iconService);
|
|
261
267
|
}
|
|
@@ -1,56 +1,11 @@
|
|
|
1
1
|
import {LTPlayer} from "../LTPlayerType";
|
|
2
|
-
import {
|
|
2
|
+
import {plyr} from "../../global/types/ModuleTypes";
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
export namespace LTPlayerControlsEvents {
|
|
6
6
|
|
|
7
7
|
export class Common {
|
|
8
8
|
|
|
9
|
-
share = {
|
|
10
|
-
getShareData(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType): defaultType | null {
|
|
11
|
-
return (instance.playerConfig.getShareData()) ? instance.playerConfig.getShareData() : null;
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
appendShareTemplate(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, shareData: defaultType) {
|
|
15
|
-
const settingsControls = instance.plyr.elements.controls.children[instance.plyr.elements.controls.children.length - 1];
|
|
16
|
-
settingsControls.insertAdjacentHTML("afterend", instance.templateService.getShare(shareData));
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
appendScriptTag() {
|
|
20
|
-
const script = document.createElement("script");
|
|
21
|
-
script.type = "text/javascript";
|
|
22
|
-
script.src = "https://static.addtoany.com/menu/page.js";
|
|
23
|
-
script.async;
|
|
24
|
-
document.body.appendChild(script);
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
getSelectors(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
28
|
-
return {
|
|
29
|
-
playerContainerControls : instance.plyr.elements.controls,
|
|
30
|
-
shareButton : instance.plyr.elements.controls.querySelector('.lt-player-share'),
|
|
31
|
-
shareContainer : instance.plyr.elements.controls.querySelector('.share-controller-wrapper')
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
activeShareModal(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, selectors: defaultType) {
|
|
36
|
-
selectors.playerContainerControls.classList.add('plyr__controls-enable-share')
|
|
37
|
-
selectors.shareContainer.classList.remove('share-inactive');
|
|
38
|
-
selectors.shareContainer.classList.add('share-active');
|
|
39
|
-
instance.plyr.pause();
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
inactiveShareModal(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType, selectors: defaultType) {
|
|
43
|
-
selectors.playerContainerControls.classList.remove('plyr__controls-enable-share')
|
|
44
|
-
selectors.shareContainer.classList.add('share-inactive');
|
|
45
|
-
selectors.shareContainer.classList.remove('share-active');
|
|
46
|
-
instance.plyr.play();
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
copyButtons(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
50
|
-
return instance.plyr.elements.container.querySelectorAll('.share-controller-link');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
9
|
backwardRewind = {
|
|
55
10
|
|
|
56
11
|
getSelectors(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
@@ -73,10 +28,33 @@ export namespace LTPlayerControlsEvents {
|
|
|
73
28
|
},
|
|
74
29
|
|
|
75
30
|
playPause(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
31
|
+
|
|
32
|
+
const playInfoIcon = instance.plyr.elements.controls.querySelector('.player-state__play-icon');
|
|
33
|
+
const pauseInfoIcon = instance.plyr.elements.controls.querySelector('.player-state__pause-icon');
|
|
34
|
+
const playerStateInfo = instance.plyr.elements.controls.querySelector('.player-state');
|
|
35
|
+
|
|
36
|
+
const removeStateButtons = () => {
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
playerStateInfo.classList.remove('active');
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
playInfoIcon.classList.add('d-none');
|
|
41
|
+
pauseInfoIcon.classList.add('d-none');
|
|
42
|
+
}, 300)
|
|
43
|
+
}, 300)
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
76
48
|
if (instance.plyr.playing) {
|
|
77
|
-
|
|
49
|
+
pauseInfoIcon.classList.remove('d-none');
|
|
50
|
+
playerStateInfo.classList.add('active');
|
|
51
|
+
instance.plyr.togglePlay(false);
|
|
52
|
+
removeStateButtons();
|
|
78
53
|
} else {
|
|
54
|
+
playInfoIcon.classList.remove('d-none');
|
|
55
|
+
playerStateInfo.classList.add('active');
|
|
79
56
|
instance.plyr.togglePlay(true);
|
|
57
|
+
removeStateButtons();
|
|
80
58
|
}
|
|
81
59
|
},
|
|
82
60
|
|
|
@@ -188,7 +166,6 @@ export namespace LTPlayerControlsEvents {
|
|
|
188
166
|
}
|
|
189
167
|
|
|
190
168
|
playPauseIcon(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType, type: string) {
|
|
191
|
-
|
|
192
169
|
switch (type) {
|
|
193
170
|
case 'timeupdate':
|
|
194
171
|
this.common.playPauseIconTimeUpdate(instance);
|
|
@@ -385,65 +362,6 @@ export namespace LTPlayerControlsEvents {
|
|
|
385
362
|
|
|
386
363
|
volumeIcons(instance.plyr.volume)
|
|
387
364
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
share(instance: LTPlayer.PortraitType | LTPlayer.LandscapeType) {
|
|
391
|
-
|
|
392
|
-
let shareData: defaultType | null = this.common.share.getShareData(instance);
|
|
393
|
-
|
|
394
|
-
if (!shareData) {
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
const common = this.common;
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
common.share.appendShareTemplate(instance, shareData);
|
|
402
|
-
common.share.appendScriptTag();
|
|
403
|
-
|
|
404
|
-
const selectors = common.share.getSelectors(instance);
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
if (selectors.shareButton) {
|
|
408
|
-
selectors.shareButton.addEventListener('click', function (event) {
|
|
409
|
-
event.preventDefault();
|
|
410
|
-
common.share.activeShareModal(instance, selectors);
|
|
411
|
-
})
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
selectors.shareContainer.addEventListener('click', function LTPlayerShareArea(event) {
|
|
415
|
-
event.preventDefault();
|
|
416
|
-
if (selectors.shareContainer.classList.contains('share-active')) {
|
|
417
|
-
let target = event.target as HTMLElement;
|
|
418
|
-
if (target.classList.contains('share-active') || target.classList.contains('player-lt__close-button')) {
|
|
419
|
-
common.share.inactiveShareModal(instance, selectors);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
})
|
|
423
|
-
|
|
424
|
-
const copyButtons: NodeListOf<Element> = common.share.copyButtons(instance);
|
|
425
|
-
|
|
426
|
-
copyButtons.forEach(button => {
|
|
427
|
-
button.addEventListener('click', function (event) {
|
|
428
|
-
event.preventDefault();
|
|
429
|
-
let value = (button as HTMLElement).dataset.copy;
|
|
430
|
-
|
|
431
|
-
if (value) {
|
|
432
|
-
navigator.clipboard.writeText(value);
|
|
433
|
-
}
|
|
434
|
-
})
|
|
435
|
-
})
|
|
436
|
-
|
|
437
|
-
const modalCloseButton = selectors.playerContainerControls.querySelector('.player-lt__close-button');
|
|
438
|
-
|
|
439
|
-
if (modalCloseButton) {
|
|
440
|
-
modalCloseButton.addEventListener('click', function (event) {
|
|
441
|
-
event.preventDefault();
|
|
442
|
-
common.share.activeShareModal(instance, selectors);
|
|
443
|
-
})
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
365
|
}
|
|
448
366
|
|
|
449
367
|
export class Mobile {
|
|
@@ -671,63 +589,6 @@ export namespace LTPlayerControlsEvents {
|
|
|
671
589
|
})
|
|
672
590
|
|
|
673
591
|
}
|
|
674
|
-
|
|
675
|
-
share(instance: LTPlayer.LandscapeType | LTPlayer.PortraitType) {
|
|
676
|
-
|
|
677
|
-
let shareData: defaultType | null = this.common.share.getShareData(instance);
|
|
678
|
-
|
|
679
|
-
if (!shareData) {
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
const common = this.common;
|
|
684
|
-
|
|
685
|
-
common.share.appendShareTemplate(instance, shareData);
|
|
686
|
-
common.share.appendScriptTag();
|
|
687
|
-
|
|
688
|
-
const selectors = common.share.getSelectors(instance);
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
if (selectors.shareButton) {
|
|
692
|
-
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(selectors.shareButton);
|
|
693
|
-
mobileEvent.on('singletap', function LTPlayerMobileShareOpenModal() {
|
|
694
|
-
common.share.activeShareModal(instance, selectors);
|
|
695
|
-
})
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(selectors.shareContainer);
|
|
699
|
-
mobileEvent.on('singletap', function LTPlayerMobileShareCloseModal(event) {
|
|
700
|
-
if (selectors.shareContainer.classList.contains('share-active')) {
|
|
701
|
-
let target = event.target as HTMLElement;
|
|
702
|
-
if (target.classList.contains('share-active') || target.classList.contains('player-lt__close-button')) {
|
|
703
|
-
common.share.inactiveShareModal(instance, selectors);
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
})
|
|
707
|
-
|
|
708
|
-
const copyButtons: NodeListOf<Element> = common.share.copyButtons(instance);
|
|
709
|
-
|
|
710
|
-
copyButtons.forEach(button => {
|
|
711
|
-
|
|
712
|
-
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(button);
|
|
713
|
-
mobileEvent.on('singletap', function LTPlayerMobileShareCopyLink() {
|
|
714
|
-
let value = (button as HTMLElement).dataset.copy;
|
|
715
|
-
|
|
716
|
-
if (value) {
|
|
717
|
-
navigator.clipboard.writeText(value);
|
|
718
|
-
}
|
|
719
|
-
})
|
|
720
|
-
})
|
|
721
|
-
|
|
722
|
-
const modalCloseButton = selectors.playerContainerControls.querySelector('.player-lt__close-button');
|
|
723
|
-
|
|
724
|
-
if (modalCloseButton) {
|
|
725
|
-
let mobileEvent: HammerManager = instance.eventInstance.mobileEvents.setMobileEvent(modalCloseButton);
|
|
726
|
-
mobileEvent.on('singletap', function LTPlayerMobileShareCloseModal() {
|
|
727
|
-
common.share.inactiveShareModal(instance, selectors);
|
|
728
|
-
})
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
592
|
}
|
|
732
593
|
|
|
733
594
|
|
|
@@ -22,7 +22,7 @@ export class LTPlayerCommon {
|
|
|
22
22
|
|
|
23
23
|
})
|
|
24
24
|
}
|
|
25
|
-
setDefaultSettingsConfig(
|
|
25
|
+
setDefaultSettingsConfig() {
|
|
26
26
|
const instance = this.player;
|
|
27
27
|
|
|
28
28
|
instance.plyr.speed = 1;
|
|
@@ -109,6 +109,9 @@ export class LTPlayerCommon {
|
|
|
109
109
|
|
|
110
110
|
onReadyPlayer() {
|
|
111
111
|
|
|
112
|
+
//set share button
|
|
113
|
+
this.player.share.events.desktop.init(this.player);
|
|
114
|
+
|
|
112
115
|
this.player.windowService.init(this.player);
|
|
113
116
|
//set poster
|
|
114
117
|
this.player.posterManager.mobileEvents.onload(this.player);
|
|
@@ -21,6 +21,8 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
21
21
|
this.plyrEndVideo();
|
|
22
22
|
this.plyrFullScreen();
|
|
23
23
|
this.plyrTimeUpdate();
|
|
24
|
+
this.plyrOnPlay();
|
|
25
|
+
this.plyrOnPause();
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
|
|
@@ -37,7 +39,7 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
|
|
40
|
-
eventManager.setDefaultSettingsConfig(
|
|
42
|
+
eventManager.setDefaultSettingsConfig();
|
|
41
43
|
|
|
42
44
|
if (instance.plyr.isHTML5) {
|
|
43
45
|
eventManager.onReadyPlayer();
|
|
@@ -66,9 +68,6 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
66
68
|
//set volume controller
|
|
67
69
|
instance.playerControl.desktopEvents.volume(instance);
|
|
68
70
|
|
|
69
|
-
//set share button
|
|
70
|
-
instance.playerControl.desktopEvents.share(instance);
|
|
71
|
-
|
|
72
71
|
//set settings controller
|
|
73
72
|
instance.playerControl.settingsControlsManager.init(instance);
|
|
74
73
|
|
|
@@ -109,7 +108,6 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
109
108
|
|
|
110
109
|
plyrEndVideo() {
|
|
111
110
|
let eventManager = this;
|
|
112
|
-
let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
113
111
|
let plyr: Plyr = this.plyr;
|
|
114
112
|
|
|
115
113
|
plyr.on('ended', function LTPlayerDesktopEndVideo() {
|
|
@@ -150,8 +148,25 @@ export class LTPlayerDesktop extends LTPlayerCommon implements EventsInterfaces
|
|
|
150
148
|
if (instance.playerConfig.getPreload().isActive) {
|
|
151
149
|
common.preloadPoster.timeUpdate(instance, 'event');
|
|
152
150
|
}
|
|
151
|
+
})
|
|
152
|
+
}
|
|
153
153
|
|
|
154
|
+
plyrOnPlay() {
|
|
155
|
+
let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
156
|
+
let plyr: Plyr = this.plyr;
|
|
157
|
+
|
|
158
|
+
plyr.on('play', function LTPlayerDesktopTimeUpdate(event) {
|
|
154
159
|
instance.playerControl.desktopEvents.playPauseIcon(instance, 'timeupdate');
|
|
155
160
|
})
|
|
156
161
|
}
|
|
162
|
+
|
|
163
|
+
plyrOnPause() {
|
|
164
|
+
let instance: LTPlayer.PortraitType | LTPlayer.LandscapeType = this.player;
|
|
165
|
+
let plyr: Plyr = this.plyr;
|
|
166
|
+
|
|
167
|
+
plyr.on('pause', function LTPlayerDesktopTimeUpdate(event) {
|
|
168
|
+
instance.playerControl.desktopEvents.playPauseIcon(instance, 'timeupdate');
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
|
|
157
172
|
}
|