@grfzhl/vue-hls-player 1.1.11 → 1.1.13

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
@@ -207,6 +207,12 @@ At the moment the following attribute are supported:
207
207
  ```
208
208
 
209
209
  ### Last release:
210
+ v1.0.13
211
+ - update the hls.js package
212
+
213
+ v1.0.12
214
+ - added component property to make it easier adding headers (like Authorization header into every hls request)
215
+
210
216
  v1.0.14 - v1.1.11
211
217
  - Fixes
212
218
  - iOS specific improvements
@@ -116,6 +116,10 @@ const props = defineProps({
116
116
  type: Boolean,
117
117
  default: false
118
118
  },
119
+ additionHeaders: {
120
+ type: Object,
121
+ default: {}
122
+ },
119
123
  /**
120
124
  * array of object, for
121
125
  * subtitles to append:
@@ -388,6 +392,21 @@ function prepareVideoPlayer(link) {
388
392
  hls.attachMedia(video.value)
389
393
  hls.recoverMediaError()
390
394
 
395
+ if(props.additionHeaders) {
396
+ /**
397
+ * inject additional headers
398
+ */
399
+ hls.config.fetchSetup = async (context, init) => {
400
+ init = init || {};
401
+ init.headers = new Headers(init.headers || {});
402
+ // set headers
403
+ for (const [key, value] of Object.entries(props.headers)) {
404
+ init.headers.set(key, value);
405
+ }
406
+ return new Request(context.url, init);
407
+ };
408
+ }
409
+
391
410
  video.value.muted = props.isMuted
392
411
  video.value.currentTime = props.progress
393
412
 
@@ -8,6 +8,7 @@
8
8
  :autoplay="autoplay"
9
9
  :isControls="isControls"
10
10
  :onVideoEnd="onVideoEnd"
11
+ :additionHeaders="additionHeaders"
11
12
  :isFullscreen="isFullscreen"
12
13
  :showTranscriptBlock="showTranscriptBlock"
13
14
  :hideInitialPlayButton="hideInitialPlayButton"
@@ -81,6 +82,10 @@ const props = defineProps({
81
82
  options: {
82
83
  type: Object,
83
84
  default: {}
85
+ },
86
+ additionHeaders: {
87
+ type: Object,
88
+ default: {}
84
89
  }
85
90
  })
86
91
 
@@ -4,6 +4,7 @@
4
4
  @pause="pause"
5
5
  @video-fullscreen-change="onVideoFullScreenChange"
6
6
  @video-ended="onVideoEnd"
7
+ :additionHeaders="additionHeaders"
7
8
  :introTitle="introTitle"
8
9
  :previewImageLink="previewImageLink"
9
10
  :showTranscriptBlock="showTranscriptBlock"
@@ -91,6 +92,10 @@ const props = defineProps({
91
92
  options: {
92
93
  type: Object,
93
94
  default: {}
95
+ },
96
+ additionHeaders: {
97
+ type: Object,
98
+ default: {}
94
99
  }
95
100
  })
96
101
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grfzhl/vue-hls-player",
3
3
  "private": false,
4
- "version": "1.1.11",
4
+ "version": "1.1.13",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -25,7 +25,7 @@
25
25
  "author": "Oliver Schörwerth",
26
26
  "license": "MIT License",
27
27
  "dependencies": {
28
- "hls.js": "^1.5.19",
28
+ "hls.js": "^1.6.13",
29
29
  "player.style": "^0.1.1"
30
30
  }
31
31
  }