Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dgw): preserve DGW access URI base in recording player #899

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions webapp/player/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
const windowURL = new URL(window.location.href);
var sessionId = windowURL.searchParams.get('sessionId');
var token = windowURL.searchParams.get('token');

var videoSrcInfo = `${windowURL.protocol}//${windowURL.host}/jet/jrec/pull/${sessionId}/recording.json?token=${token}`;
const gatewayAccessUrl = windowURL.toString().split("/jet/jrec")[0];
var videoSrcInfo = `${gatewayAccessUrl}/jet/jrec/pull/${sessionId}/recording.json?token=${token}`;
var request = new XMLHttpRequest();

request.onreadystatechange = function () {
Expand All @@ -61,7 +61,7 @@
document.body.appendChild(videoPlayer)

// initialize the video player
let videoSrc = `${windowURL.protocol}//${windowURL.host}/jet/jrec/pull/${sessionId}/${recordingInfo.files[0].fileName}?token=${token}`;
let videoSrc = `${gatewayAccessUrl}/jet/jrec/pull/${sessionId}/${recordingInfo.files[0].fileName}?token=${token}`;
videoSrcElement.setAttribute('src', videoSrc);

// set up video cycling
Expand All @@ -73,7 +73,7 @@
if (currentIndex > maxIndex) {
currentIndex = 0;
}
videoSrc = `${windowURL.protocol}//${windowURL.host}/jet/jrec/pull/${sessionId}/${recordingInfo.files[currentIndex].fileName}?token=${token}`;
videoSrc = `${gatewayAccessUrl}/jet/jrec/pull/${sessionId}/${recordingInfo.files[currentIndex].fileName}?token=${token}`;
videoSrcElement.setAttribute('src', videoSrc);
videoPlayer.load();
videoPlayer.play();
Expand All @@ -87,7 +87,7 @@
var terminalDiv = document.createElement("div")
document.body.appendChild(terminalDiv)

let trpSrc = `${windowURL.protocol}//${windowURL.host}/jet/jrec/pull/${sessionId}/${recordingInfo.files[0].fileName}?token=${token}`
let trpSrc = `${gatewayAccessUrl}/jet/jrec/pull/${sessionId}/${recordingInfo.files[0].fileName}?token=${token}`

loadFile(trpSrc, function(trpFileContent) {

Expand All @@ -110,7 +110,7 @@
var terminalDiv = document.createElement("div")
document.body.appendChild(terminalDiv)

let castSrc = `${windowURL.protocol}//${windowURL.host}/jet/jrec/pull/${sessionId}/${recordingInfo.files[currentIndex].fileName}?token=${token}`
let castSrc = `${gatewayAccessUrl}/jet/jrec/pull/${sessionId}/${recordingInfo.files[currentIndex].fileName}?token=${token}`

loadFile(castSrc, function(castFileContent) {

Expand Down