@grfzhl/vue-hls-player 1.1.10 → 1.1.11
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
CHANGED
|
@@ -187,7 +187,33 @@ it makes the video muted
|
|
|
187
187
|
|
|
188
188
|
it will set the native <video> autoplay property
|
|
189
189
|
|
|
190
|
+
**options**
|
|
191
|
+
1. value: object with settings, type Object
|
|
192
|
+
|
|
193
|
+
It contains various options to customize
|
|
194
|
+
the player.
|
|
195
|
+
At the moment the following attribute are supported:
|
|
196
|
+
```
|
|
197
|
+
ui: {
|
|
198
|
+
labels: {
|
|
199
|
+
play: 'Play',
|
|
200
|
+
pause: 'Pause',
|
|
201
|
+
fullscreen: 'Toggle fullscreen',
|
|
202
|
+
exitFullscreen: 'Toggle fullscreen',
|
|
203
|
+
mute: 'Mute',
|
|
204
|
+
unmute: 'Unmute',
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
190
209
|
### Last release:
|
|
210
|
+
v1.0.14 - v1.1.11
|
|
211
|
+
- Fixes
|
|
212
|
+
- iOS specific improvements
|
|
213
|
+
- New Options to customize the component
|
|
214
|
+
- Fix problem with not updating transcript highlighting
|
|
215
|
+
- Extending overloaded functions for fullscreen mode (WIP)
|
|
216
|
+
|
|
191
217
|
v1.0.9 - v1.0.14
|
|
192
218
|
- Fixes
|
|
193
219
|
- Small styling improvements
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
<slot name="before-media"></slot>
|
|
21
21
|
<media-theme-sutro class="video-player-theme-container" :class="{'is-fullscreen': isFullscreen}">
|
|
22
|
+
|
|
22
23
|
<video
|
|
23
24
|
class="hls-player"
|
|
24
25
|
slot="media"
|
|
@@ -49,6 +50,16 @@
|
|
|
49
50
|
@error="onSubtitleError(subtitle.link)"
|
|
50
51
|
:label="subtitle.label" :default="i === 0" />
|
|
51
52
|
</video>
|
|
53
|
+
<media-control-bar>
|
|
54
|
+
<media-fullscreen-button>
|
|
55
|
+
<span slot="tooltip-enter" v-if="options?.ui?.labels?.fullscreen">
|
|
56
|
+
{{ options.ui.labels.fullscreen }}
|
|
57
|
+
</span>
|
|
58
|
+
<span slot="tooltip-exit" v-if="options?.ui?.labels?.exitFullscreen">
|
|
59
|
+
{{ options.ui.labels.exitFullscreen }}
|
|
60
|
+
</span>
|
|
61
|
+
</media-fullscreen-button>
|
|
62
|
+
</media-control-bar>
|
|
52
63
|
</media-theme-sutro>
|
|
53
64
|
<div class="custom-subtitles" v-show="(isFullscreen) || (!showTranscriptBlock)">
|
|
54
65
|
<div class="subtitle-text" ref="subtitlesContainer" style="display: none;"></div>
|
|
@@ -60,7 +71,8 @@
|
|
|
60
71
|
<SubtitleBlock
|
|
61
72
|
ref="transcriptRef"
|
|
62
73
|
:subtitle="currentSubtitle"
|
|
63
|
-
:cursor="videoCursor"
|
|
74
|
+
:cursor="videoCursor"
|
|
75
|
+
:options="options"
|
|
64
76
|
:showTranscriptBlock="showTranscriptBlock"
|
|
65
77
|
@seek="seekVideo"
|
|
66
78
|
@toggleTranscript="toggleTranscript">
|
|
@@ -132,6 +144,10 @@ const props = defineProps({
|
|
|
132
144
|
fullScreenElement: {
|
|
133
145
|
type: String,
|
|
134
146
|
default: 'hls-player-media-container'
|
|
147
|
+
},
|
|
148
|
+
options: {
|
|
149
|
+
type: Object,
|
|
150
|
+
default: {}
|
|
135
151
|
}
|
|
136
152
|
})
|
|
137
153
|
|
|
@@ -150,6 +166,7 @@ const previewImageLink = toRef(props, 'previewImageLink');
|
|
|
150
166
|
const link = toRef(props, 'link');
|
|
151
167
|
let currentTime = 0
|
|
152
168
|
let hls = null
|
|
169
|
+
let buttonElement = null
|
|
153
170
|
|
|
154
171
|
const videoElement = defineModel()
|
|
155
172
|
|
|
@@ -217,9 +234,49 @@ async function startFullscreen() {
|
|
|
217
234
|
document.webkitExitFullscreen();
|
|
218
235
|
}
|
|
219
236
|
isFullscreen.value = false;
|
|
237
|
+
buttonElement.setAttribute('aria-label', "Enter fullscreen mode")
|
|
238
|
+
const tooltip = buttonElement.querySelector('media-tooltip');
|
|
239
|
+
|
|
240
|
+
if (tooltip) {
|
|
241
|
+
console.log("Tooltip gefunden:", tooltip);
|
|
242
|
+
|
|
243
|
+
// Slots für Tooltip-Enter und Tooltip-Exit finden
|
|
244
|
+
const enterTooltip = tooltip.querySelector('slot[name="tooltip-enter"]');
|
|
245
|
+
const exitTooltip = tooltip.querySelector('slot[name="tooltip-exit"]');
|
|
246
|
+
|
|
247
|
+
if (enterTooltip && exitTooltip) {
|
|
248
|
+
enterTooltip.style.display = 'block';
|
|
249
|
+
exitTooltip.style.display = 'none';
|
|
250
|
+
} else {
|
|
251
|
+
console.warn("Tooltip-Slots nicht gefunden!");
|
|
252
|
+
}
|
|
253
|
+
} else {
|
|
254
|
+
console.warn("Kein media-tooltip gefunden!");
|
|
255
|
+
}
|
|
220
256
|
} else {
|
|
221
257
|
isFullscreen.value = true;
|
|
222
258
|
try {
|
|
259
|
+
buttonElement.setAttribute('aria-label', "Exit fullscreen mode")
|
|
260
|
+
|
|
261
|
+
const tooltip = buttonElement.querySelector('media-tooltip');
|
|
262
|
+
|
|
263
|
+
if (tooltip) {
|
|
264
|
+
console.log("Tooltip gefunden:", tooltip);
|
|
265
|
+
|
|
266
|
+
// Slots für Tooltip-Enter und Tooltip-Exit finden
|
|
267
|
+
const enterTooltip = tooltip.querySelector('slot[name="tooltip-enter"]');
|
|
268
|
+
const exitTooltip = tooltip.querySelector('slot[name="tooltip-exit"]');
|
|
269
|
+
|
|
270
|
+
if (enterTooltip && exitTooltip) {
|
|
271
|
+
enterTooltip.style.display = 'none';
|
|
272
|
+
exitTooltip.style.display = 'block';
|
|
273
|
+
} else {
|
|
274
|
+
console.warn("Tooltip-Slots nicht gefunden!");
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
console.warn("Kein media-tooltip gefunden!");
|
|
278
|
+
}
|
|
279
|
+
|
|
223
280
|
if (vpVideoBlock.requestFullscreen) {
|
|
224
281
|
await vpVideoBlock.requestFullscreen();
|
|
225
282
|
} else if (/iPhone|iPad|AppleWebKit/i.test(navigator.userAgent)) {
|
|
@@ -420,6 +477,7 @@ function initVideo() {
|
|
|
420
477
|
const mediaTheme = document.querySelector('.video-player-theme-container');
|
|
421
478
|
if (mediaTheme && mediaTheme.shadowRoot) {
|
|
422
479
|
const fullscreenButton = mediaTheme.shadowRoot.querySelector('media-fullscreen-button');
|
|
480
|
+
buttonElement = fullscreenButton
|
|
423
481
|
const playbackRateButton = mediaTheme.shadowRoot.querySelector('media-playback-rate-menu');
|
|
424
482
|
playbackRateButton.setAttribute('rates', '0.25 0.5 0.75 1 1.5 2 3');
|
|
425
483
|
if (fullscreenButton) {
|