From 804077263c40d78d4f45dc3ba65342701d346684 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Mon, 30 Nov 2020 13:35:50 -0500 Subject: [PATCH] Revert "Remove withCredentials from xhrSetup in hls.js" This reverts commit 3a8e0394dccf0ebc23d5f46b2e09e484af134bd5. --- src/plugins/htmlAudioPlayer/plugin.js | 5 ++++- src/plugins/htmlVideoPlayer/plugin.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/htmlAudioPlayer/plugin.js b/src/plugins/htmlAudioPlayer/plugin.js index 975e6f8a6..1917954fa 100644 --- a/src/plugins/htmlAudioPlayer/plugin.js +++ b/src/plugins/htmlAudioPlayer/plugin.js @@ -131,7 +131,10 @@ class HtmlAudioPlayer { return new Promise(function (resolve, reject) { requireHlsPlayer(function () { const hls = new Hls({ - manifestLoadingTimeOut: 20000 + manifestLoadingTimeOut: 20000, + xhrSetup: function (xhr, url) { + xhr.withCredentials = true; + } }); hls.loadSource(val); hls.attachMedia(elem); diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index b4fcec21e..04b0fbea2 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -398,7 +398,10 @@ function tryRemoveElement(elem) { const hls = new Hls({ manifestLoadingTimeOut: 20000, maxBufferLength: maxBufferLength, - maxMaxBufferLength: maxMaxBufferLength + maxMaxBufferLength: maxMaxBufferLength, + xhrSetup(xhr) { + xhr.withCredentials = true; + } }); hls.loadSource(url); hls.attachMedia(elem);