Skip to content

Commit b82d143

Browse files
authored
fix: seek-thumbs vtt is being called without credentials (#794)
* fix: seek-thumbs vtt is being called without credentials * chore: cleanup * fix: send credentials in handleCldError * fix: send credentials when fetching highlights-graph
1 parent 4428960 commit b82d143

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/plugins/ai-highlights-graph/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ const HighlightsGraphPlugin = (function () {
9090
return;
9191
}
9292

93-
fetch(this.options.src).then((res) => {
93+
fetch(this.options.src, {
94+
credentials: this.player.cloudinary.source?.().withCredentials ? 'include' : 'omit'
95+
}).then((res) => {
9496
return res.json();
9597
}).then((res) => {
9698
this.setupHighlightsGraphElement();

src/plugins/vtt-thumbnails/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ const VttThumbnailsPlugin = (function () {
9898
return;
9999
}
100100

101-
fetch(this.options.src)
101+
fetch(this.options.src, {
102+
credentials: this.player.cloudinary.source?.().withCredentials ? 'include' : 'omit'
103+
})
102104
.then((res) => {
103105
return res.text();
104106
})

src/utils/cloudinary.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ const setVideoSrc = (that, srcs) => {
4444
};
4545

4646
const handleCldError = (that, options) => {
47-
const opts = options.fetchErrorUsingGet ? ERROR_WITH_GET_REQUEST : GET_ERROR_DEFAULT_REQUEST;
4847
const srcs = that.videojs.cloudinary.getCurrentSources();
48+
const opts = options.fetchErrorUsingGet ? ERROR_WITH_GET_REQUEST : GET_ERROR_DEFAULT_REQUEST;
49+
opts.credentials = options.withCredentials ? 'include' : 'omit';
4950

5051
if (srcs.length > 0) {
5152
Promise.all(srcs.map((s) => fetch(s.src, opts))).then((res) => {

0 commit comments

Comments
 (0)