myetv-player 1.0.6 → 1.0.8
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/README.md +13 -0
- package/css/myetv-player.css +123 -1
- package/css/myetv-player.min.css +1 -1
- package/dist/myetv-player.js +48 -1
- package/dist/myetv-player.min.js +38 -1
- package/package.json +2 -1
- package/scss/_controls.scss +184 -30
- package/src/controls.js +1 -1
- package/src/core.js +47 -0
package/dist/myetv-player.js
CHANGED
|
@@ -448,6 +448,8 @@ constructor(videoElement, options = {}) {
|
|
|
448
448
|
dashLibUrl: 'https://cdn.dashjs.org/latest/dash.all.min.js', // Dash.js library URL
|
|
449
449
|
hlsLibUrl: 'https://cdn.jsdelivr.net/npm/hls.js@latest', // HLS.js library URL
|
|
450
450
|
adaptiveQualityControl: true, // Show quality control for adaptive streams
|
|
451
|
+
//seek shape
|
|
452
|
+
seekHandleShape: 'circle', // Available shape: none, circle, square, diamond, arrow, triangle, heart, star
|
|
451
453
|
// AUDIO PLAYER
|
|
452
454
|
audiofile: false,
|
|
453
455
|
audiowave: false,
|
|
@@ -2091,6 +2093,51 @@ loadScript(src) {
|
|
|
2091
2093
|
});
|
|
2092
2094
|
}
|
|
2093
2095
|
|
|
2096
|
+
/**
|
|
2097
|
+
* Set seek handle shape dynamically
|
|
2098
|
+
* @param {string} shape - Shape type: none, circle, square, diamond, arrow, triangle, heart, star
|
|
2099
|
+
* @returns {Object} this
|
|
2100
|
+
*/
|
|
2101
|
+
setSeekHandleShape(shape) {
|
|
2102
|
+
const validShapes = ['none', 'circle', 'square', 'diamond', 'arrow', 'triangle', 'heart', 'star'];
|
|
2103
|
+
|
|
2104
|
+
if (!validShapes.includes(shape)) {
|
|
2105
|
+
if (this.options.debug) console.warn('Invalid seek handle shape:', shape);
|
|
2106
|
+
return this;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
this.options.seekHandleShape = shape;
|
|
2110
|
+
|
|
2111
|
+
// Update handle class
|
|
2112
|
+
if (this.progressHandle) {
|
|
2113
|
+
// Remove all shape classes
|
|
2114
|
+
validShapes.forEach(s => {
|
|
2115
|
+
this.progressHandle.classList.remove(`progress-handle-${s}`);
|
|
2116
|
+
});
|
|
2117
|
+
// Add new shape class
|
|
2118
|
+
this.progressHandle.classList.add(`progress-handle-${shape}`);
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
if (this.options.debug) console.log('Seek handle shape changed to:', shape);
|
|
2122
|
+
return this;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* Get current seek handle shape
|
|
2127
|
+
* @returns {string} Current shape
|
|
2128
|
+
*/
|
|
2129
|
+
getSeekHandleShape() {
|
|
2130
|
+
return this.options.seekHandleShape;
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
/**
|
|
2134
|
+
* Get available seek handle shapes
|
|
2135
|
+
* @returns {Array} Array of available shapes
|
|
2136
|
+
*/
|
|
2137
|
+
getAvailableSeekHandleShapes() {
|
|
2138
|
+
return ['none', 'circle', 'square', 'diamond', 'arrow', 'triangle', 'heart', 'star'];
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2094
2141
|
dispose() {
|
|
2095
2142
|
if (this.qualityMonitorInterval) {
|
|
2096
2143
|
clearInterval(this.qualityMonitorInterval);
|
|
@@ -2851,7 +2898,7 @@ createControls() {
|
|
|
2851
2898
|
<div class="progress-bar">
|
|
2852
2899
|
<div class="progress-buffer"></div>
|
|
2853
2900
|
<div class="progress-filled"></div>
|
|
2854
|
-
<div class="progress-handle"></div>
|
|
2901
|
+
<div class="progress-handle progress-handle-${this.options.seekHandleShape}"></div>
|
|
2855
2902
|
</div>
|
|
2856
2903
|
${this.options.showSeekTooltip ? '<div class="seek-tooltip">0:00</div>' : ''}
|
|
2857
2904
|
</div>
|
package/dist/myetv-player.min.js
CHANGED
|
@@ -435,6 +435,8 @@ constructor(videoElement, options = {}) {
|
|
|
435
435
|
hlsLibUrl: 'https://cdn.jsdelivr.net/npm/hls.js@latest',
|
|
436
436
|
adaptiveQualityControl: true,
|
|
437
437
|
|
|
438
|
+
seekHandleShape: 'circle',
|
|
439
|
+
|
|
438
440
|
audiofile: false,
|
|
439
441
|
audiowave: false,
|
|
440
442
|
|
|
@@ -2038,6 +2040,41 @@ loadScript(src) {
|
|
|
2038
2040
|
});
|
|
2039
2041
|
}
|
|
2040
2042
|
|
|
2043
|
+
|
|
2044
|
+
setSeekHandleShape(shape) {
|
|
2045
|
+
const validShapes = ['none', 'circle', 'square', 'diamond', 'arrow', 'triangle', 'heart', 'star'];
|
|
2046
|
+
|
|
2047
|
+
if (!validShapes.includes(shape)) {
|
|
2048
|
+
if (this.options.debug) console.warn('Invalid seek handle shape:', shape);
|
|
2049
|
+
return this;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
this.options.seekHandleShape = shape;
|
|
2053
|
+
|
|
2054
|
+
|
|
2055
|
+
if (this.progressHandle) {
|
|
2056
|
+
|
|
2057
|
+
validShapes.forEach(s => {
|
|
2058
|
+
this.progressHandle.classList.remove(`progress-handle-${s}`);
|
|
2059
|
+
});
|
|
2060
|
+
|
|
2061
|
+
this.progressHandle.classList.add(`progress-handle-${shape}`);
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
if (this.options.debug) console.log('Seek handle shape changed to:', shape);
|
|
2065
|
+
return this;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
|
|
2069
|
+
getSeekHandleShape() {
|
|
2070
|
+
return this.options.seekHandleShape;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
|
|
2074
|
+
getAvailableSeekHandleShapes() {
|
|
2075
|
+
return ['none', 'circle', 'square', 'diamond', 'arrow', 'triangle', 'heart', 'star'];
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2041
2078
|
dispose() {
|
|
2042
2079
|
if (this.qualityMonitorInterval) {
|
|
2043
2080
|
clearInterval(this.qualityMonitorInterval);
|
|
@@ -2772,7 +2809,7 @@ createControls() {
|
|
|
2772
2809
|
<div class="progress-bar">
|
|
2773
2810
|
<div class="progress-buffer"></div>
|
|
2774
2811
|
<div class="progress-filled"></div>
|
|
2775
|
-
<div class="progress-handle"></div>
|
|
2812
|
+
<div class="progress-handle progress-handle-${this.options.seekHandleShape}"></div>
|
|
2776
2813
|
</div>
|
|
2777
2814
|
${this.options.showSeekTooltip ? '<div class="seek-tooltip">0:00</div>' : ''}
|
|
2778
2815
|
</div>
|
package/package.json
CHANGED
package/scss/_controls.scss
CHANGED
|
@@ -1,30 +1,184 @@
|
|
|
1
|
-
// ===================================
|
|
2
|
-
// CONTROLS
|
|
3
|
-
// ===================================
|
|
4
|
-
|
|
5
|
-
@use 'mixins' as *;
|
|
6
|
-
@use 'variables' as *;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
padding:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
1
|
+
// ===================================
|
|
2
|
+
// CONTROLS
|
|
3
|
+
// ===================================
|
|
4
|
+
|
|
5
|
+
@use 'mixins' as *;
|
|
6
|
+
@use 'variables' as *;
|
|
7
|
+
|
|
8
|
+
// ===================================
|
|
9
|
+
// PROGRESS BAR SYSTEM
|
|
10
|
+
// ===================================
|
|
11
|
+
|
|
12
|
+
.progress-container {
|
|
13
|
+
position: relative;
|
|
14
|
+
overflow: visible !important; // Allow handle to extend outside the container
|
|
15
|
+
padding: 0; // No padding - keeps control bar height normal
|
|
16
|
+
margin-bottom: 10px; // Space below instead of padding
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center; // Vertically center the progress bar
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.progress-bar {
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 4px; // Thin progress bar
|
|
26
|
+
background: rgba(255, 255, 255, 0.3); // Semi-transparent background
|
|
27
|
+
border-radius: 2px;
|
|
28
|
+
overflow: visible !important; // Allow handle to be visible
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Buffer bar (shows buffered/loaded video)
|
|
33
|
+
.progress-buffer {
|
|
34
|
+
position: absolute;
|
|
35
|
+
left: 0;
|
|
36
|
+
top: 0;
|
|
37
|
+
height: 100%;
|
|
38
|
+
background: rgba(255, 255, 255, 0.5);
|
|
39
|
+
border-radius: 2px;
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
z-index: 1; // Below filled bar
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Filled bar (shows watched video progress)
|
|
45
|
+
.progress-filled {
|
|
46
|
+
position: absolute;
|
|
47
|
+
left: 0;
|
|
48
|
+
top: 0;
|
|
49
|
+
height: 100%;
|
|
50
|
+
background: var(--player-accent, #ff0000); // Accent color fill
|
|
51
|
+
border-radius: 2px;
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
z-index: 2; // Above buffer, below handle
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ===================================
|
|
57
|
+
// PROGRESS HANDLE - BASE STYLES
|
|
58
|
+
// ===================================
|
|
59
|
+
|
|
60
|
+
.progress-handle {
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 50%;
|
|
63
|
+
left: 0%;
|
|
64
|
+
transform: translate(-50%, -50%); // Center the handle
|
|
65
|
+
width: 14px;
|
|
66
|
+
height: 14px;
|
|
67
|
+
background: var(--player-accent, #ff0000);
|
|
68
|
+
cursor: grab; // Indicates draggable
|
|
69
|
+
transition: opacity 0.2s ease;
|
|
70
|
+
z-index: 10; // Above everything (buffer and filled)
|
|
71
|
+
pointer-events: auto; // Ensure it's clickable
|
|
72
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); // Subtle shadow for depth
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Grabbing cursor when actively dragging
|
|
76
|
+
.progress-handle:active {
|
|
77
|
+
cursor: grabbing;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ===================================
|
|
81
|
+
// SEEK HANDLE SHAPES
|
|
82
|
+
// ===================================
|
|
83
|
+
|
|
84
|
+
// Circle - classic round handle (default recommended)
|
|
85
|
+
.progress-handle-circle {
|
|
86
|
+
border-radius: 50%; // Perfect circle
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Square - sharp corners
|
|
90
|
+
.progress-handle-square {
|
|
91
|
+
border-radius: 3px; // Slightly rounded corners
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Diamond - rotated square
|
|
95
|
+
.progress-handle-diamond {
|
|
96
|
+
border-radius: 2px;
|
|
97
|
+
transform: translate(-50%, -50%) rotate(45deg); // 45 degree rotation
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Arrow - pointing upward
|
|
101
|
+
.progress-handle-arrow {
|
|
102
|
+
background: transparent;
|
|
103
|
+
width: 0 !important;
|
|
104
|
+
height: 0 !important;
|
|
105
|
+
border-left: 7px solid transparent;
|
|
106
|
+
border-right: 7px solid transparent;
|
|
107
|
+
border-bottom: 14px solid var(--player-accent, #ff0000); // Triangle pointing up
|
|
108
|
+
border-radius: 0;
|
|
109
|
+
box-shadow: none; // No shadow for border-based shapes
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Triangle - simple triangle shape
|
|
113
|
+
.progress-handle-triangle {
|
|
114
|
+
background: transparent;
|
|
115
|
+
width: 0 !important;
|
|
116
|
+
height: 0 !important;
|
|
117
|
+
border-left: 8px solid transparent;
|
|
118
|
+
border-right: 8px solid transparent;
|
|
119
|
+
border-bottom: 14px solid var(--player-accent, #ff0000);
|
|
120
|
+
border-radius: 0;
|
|
121
|
+
box-shadow: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Heart - romantic shape using clip-path
|
|
125
|
+
.progress-handle-heart {
|
|
126
|
+
width: 16px !important;
|
|
127
|
+
height: 16px !important;
|
|
128
|
+
clip-path: polygon( 50% 15%, 65% 0%, 80% 0%, 95% 15%, 95% 30%, 50% 85%, 5% 30%, 5% 15%, 20% 0%, 35% 0% );
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Star - five-pointed star using clip-path
|
|
132
|
+
.progress-handle-star {
|
|
133
|
+
width: 16px !important;
|
|
134
|
+
height: 16px !important;
|
|
135
|
+
clip-path: polygon( 50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35% );
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// None - completely hidden (no visual indicator)
|
|
139
|
+
.progress-handle-none {
|
|
140
|
+
opacity: 0 !important;
|
|
141
|
+
pointer-events: none !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ===================================
|
|
145
|
+
// FORCE HANDLE ALWAYS VISIBLE
|
|
146
|
+
// ===================================
|
|
147
|
+
|
|
148
|
+
// Override any other rule that hides the handle
|
|
149
|
+
.progress-handle {
|
|
150
|
+
opacity: 1 !important; // Always visible
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.progress-container .progress-handle {
|
|
154
|
+
opacity: 1 !important; // Always visible with higher specificity
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// ===================================
|
|
158
|
+
// CONTROLS CONTAINER
|
|
159
|
+
// ===================================
|
|
160
|
+
|
|
161
|
+
/* Main controls container */
|
|
162
|
+
.controls {
|
|
163
|
+
position: absolute;
|
|
164
|
+
bottom: 0;
|
|
165
|
+
left: 0;
|
|
166
|
+
right: 0;
|
|
167
|
+
background: var(--player-bg-controls);
|
|
168
|
+
padding: var(--player-controls-padding);
|
|
169
|
+
opacity: 0; // Hidden by default
|
|
170
|
+
transform: translateY(100%); // Slide out below
|
|
171
|
+
transition: all var(--player-transition-normal);
|
|
172
|
+
z-index: 10;
|
|
173
|
+
min-height: 70px !important;
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Controls visible state */
|
|
178
|
+
.controls.show {
|
|
179
|
+
opacity: 1; // Fully visible
|
|
180
|
+
transform: translateY(0); // Slide in
|
|
181
|
+
position: absolute !important;
|
|
182
|
+
bottom: 0 !important;
|
|
183
|
+
z-index: 20 !important; // Above other elements
|
|
184
|
+
}
|
package/src/controls.js
CHANGED
|
@@ -354,7 +354,7 @@ createControls() {
|
|
|
354
354
|
<div class="progress-bar">
|
|
355
355
|
<div class="progress-buffer"></div>
|
|
356
356
|
<div class="progress-filled"></div>
|
|
357
|
-
<div class="progress-handle"></div>
|
|
357
|
+
<div class="progress-handle progress-handle-${this.options.seekHandleShape}"></div>
|
|
358
358
|
</div>
|
|
359
359
|
${this.options.showSeekTooltip ? '<div class="seek-tooltip">0:00</div>' : ''}
|
|
360
360
|
</div>
|
package/src/core.js
CHANGED
|
@@ -52,6 +52,8 @@ constructor(videoElement, options = {}) {
|
|
|
52
52
|
dashLibUrl: 'https://cdn.dashjs.org/latest/dash.all.min.js', // Dash.js library URL
|
|
53
53
|
hlsLibUrl: 'https://cdn.jsdelivr.net/npm/hls.js@latest', // HLS.js library URL
|
|
54
54
|
adaptiveQualityControl: true, // Show quality control for adaptive streams
|
|
55
|
+
//seek shape
|
|
56
|
+
seekHandleShape: 'circle', // Available shape: none, circle, square, diamond, arrow, triangle, heart, star
|
|
55
57
|
// AUDIO PLAYER
|
|
56
58
|
audiofile: false,
|
|
57
59
|
audiowave: false,
|
|
@@ -1695,6 +1697,51 @@ loadScript(src) {
|
|
|
1695
1697
|
});
|
|
1696
1698
|
}
|
|
1697
1699
|
|
|
1700
|
+
/**
|
|
1701
|
+
* Set seek handle shape dynamically
|
|
1702
|
+
* @param {string} shape - Shape type: none, circle, square, diamond, arrow, triangle, heart, star
|
|
1703
|
+
* @returns {Object} this
|
|
1704
|
+
*/
|
|
1705
|
+
setSeekHandleShape(shape) {
|
|
1706
|
+
const validShapes = ['none', 'circle', 'square', 'diamond', 'arrow', 'triangle', 'heart', 'star'];
|
|
1707
|
+
|
|
1708
|
+
if (!validShapes.includes(shape)) {
|
|
1709
|
+
if (this.options.debug) console.warn('Invalid seek handle shape:', shape);
|
|
1710
|
+
return this;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
this.options.seekHandleShape = shape;
|
|
1714
|
+
|
|
1715
|
+
// Update handle class
|
|
1716
|
+
if (this.progressHandle) {
|
|
1717
|
+
// Remove all shape classes
|
|
1718
|
+
validShapes.forEach(s => {
|
|
1719
|
+
this.progressHandle.classList.remove(`progress-handle-${s}`);
|
|
1720
|
+
});
|
|
1721
|
+
// Add new shape class
|
|
1722
|
+
this.progressHandle.classList.add(`progress-handle-${shape}`);
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
if (this.options.debug) console.log('Seek handle shape changed to:', shape);
|
|
1726
|
+
return this;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* Get current seek handle shape
|
|
1731
|
+
* @returns {string} Current shape
|
|
1732
|
+
*/
|
|
1733
|
+
getSeekHandleShape() {
|
|
1734
|
+
return this.options.seekHandleShape;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* Get available seek handle shapes
|
|
1739
|
+
* @returns {Array} Array of available shapes
|
|
1740
|
+
*/
|
|
1741
|
+
getAvailableSeekHandleShapes() {
|
|
1742
|
+
return ['none', 'circle', 'square', 'diamond', 'arrow', 'triangle', 'heart', 'star'];
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1698
1745
|
dispose() {
|
|
1699
1746
|
if (this.qualityMonitorInterval) {
|
|
1700
1747
|
clearInterval(this.qualityMonitorInterval);
|