Skip to content

Commit

Permalink
ios video src set permission fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshvdw committed Dec 16, 2024
1 parent 24ddcf4 commit 1827125
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
11 changes: 10 additions & 1 deletion dist/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/app.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion js/global/dynamicVideos.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ function setVideoSource(video) {
}
} else {
if (videoElem.getAttribute("src") !== videoSrc) {
videoElem.src = videoSrc;
try {
videoElem.pause(); // Pause the video before changing the src
videoElem.removeAttribute("src"); // Clear the current src to ensure a fresh load
videoElem.setAttribute("src", videoSrc); // Set the new src
videoElem.load(); // Explicitly load the video
} catch (error) {
console.warn(`Failed to update video source for ${video}`, error);
}
}
}

Expand Down

0 comments on commit 1827125

Please sign in to comment.