This is a weird problem that I have where the backdrop-filter: blur(5px) in this css & html code:
.overlay {
position: absolute;
top: 44%;
right: 5%;
width: 16%;
height: 29%;
z-index: 2;
/*background-color: black; */
-webkit-backdrop-filter: blur(5px)!important;
backdrop-filter: blur(5px)!important; /* Adjust the blur radius as needed */
background: inherent
}
<div class="image-container" id="embedLinkContainer">
<div class="overlay"></div>
</div>
works for web browsers on computers but only works on some mobile devices.
When I combine the above html with this javascript code:
document.addEventListener("DOMContentLoaded", function() {
var videoId = 7244605496349445403n;
console.log(videoId)
// Define the base TikTok embed URL and language parameter
const baseEmbedUrl = "https://www.tiktok.com/embed/v2/";
const langParam = "?lang=en-US";
// Construct the dynamic TikTok embed link using the videoId and language parameter
const dynamicEmbedLink = `${baseEmbedUrl}${videoId}${langParam}`;
// Create a new iframe element
const iframe = document.createElement('iframe');
iframe.setAttribute('src', dynamicEmbedLink);
iframe.setAttribute('width', '327'); // Set width as needed 327
iframe.setAttribute('height', '775'); // Set height as needed 775
iframe.setAttribute('frameborder', '5'); // Optional: Remove iframe border
document.getElementById('embedLinkContainer').appendChild(iframe);
});
the blur applies to mobile web browsers, but this javascript:
$(document).ready(function() {
$.ajax({
type: "POST",
url: "my_python_flask_link/get_video_data",
success: function(response) {
var videoId = response.video_id;
console.log(videoId)
// Define the base TikTok embed URL and language parameter
const baseEmbedUrl = "https://www.tiktok.com/embed/v2/";
const langParam = "?lang=en-US";
// Construct the dynamic TikTok embed link using the videoId and language parameter
const dynamicEmbedLink = `${baseEmbedUrl}${videoId}${langParam}`;
// Create a new iframe element
const iframe = document.createElement('iframe');
iframe.setAttribute('src', dynamicEmbedLink);
iframe.setAttribute('width', '327'); // Set width as needed 327
iframe.setAttribute('height', '775'); // Set height as needed 775
iframe.setAttribute('frameborder', '5'); // Optional: Remove iframe border
document.getElementById('embedLinkContainer').appendChild(iframe);
}
})
});
which uses an ajax request to make the video id dynamic, does not apply the blur on mobile devices.
Using an ajax request to dynamically change the video id is essential for my website.
What may be causing this issue?










