Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. H

    JavaScript Set breakpoint on loading time

    @EkBass @cbreemer thank you both for your help! I came up with two solutions. Actually, @EkBass idea was close. Let's say I want to find a code that is inserting a new attribute ''data-lodaded=true", in a div with class ''target" The first solution is to insert a "debugger" statement right...
  2. H

    JavaScript Set breakpoint on loading time

    Hello there! Sometimes, I want to locate a code that is changing a DOM element. For example, on Chrome I can set a breakpoint "On attribute modifications" for a specific DOM element, so the browser will break when such element has attribute modifications, and I can inspect the code. However...
  3. H

    JavaScript Safari can't play videos with sound using IntersectionObserver

    I am using Safari 15.6, so maybe the new versions fixed that bug
  4. H

    JavaScript Safari can't play videos with sound using IntersectionObserver

    It is OK! Your answers are always welcome.
  5. H

    JavaScript Safari can't play videos with sound using IntersectionObserver

    Hello and thanks for your quick answer! In my previous code, the script is trying to play the video inside a click event handler, which is considered user interaction. I have the same settings, "Stop media with Sound", for all websites, so for example, I can open a Youtube video or Short and...
  6. H

    JavaScript Safari can't play videos with sound using IntersectionObserver

    Here I attach a good example of my problem: <!DOCTYPE html> <html lang="en"> <body> <video playsinline> <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4"> </video> <script> const video = document.querySelector('video')...
  7. H

    JavaScript Safari can't play videos with sound using IntersectionObserver

    I checked if there was a setting like you mentioned but did not find anything. I can only play videos with sound inside a click event handler, as it is considered a user interaction. If I try to play videos outside a click handler, the video play raises a NotAllowedError exception, even though...
  8. H

    JavaScript Safari can't play videos with sound using IntersectionObserver

    Yes, Safari does support the intersection observer. If I set the 'video.play()' inside an event handler, the video is played, paused when out of the view port, and played again when it is inside the view port via an Intersection Observer
  9. H

    JavaScript Safari can't play videos with sound using IntersectionObserver

    Hello there! I am having trouble playing videos with sound in Safari. The videos are not played by a click, but when they are visible on the screen by using an Intersection Observer. In Firefox, once there has been some user interaction with the page, a click for example, I can do this...
  10. H

    JavaScript Free memory of HTMLVideoElement

    Hello! And sorry for the late response. You were right, removing the video via 'video.remove()' won't free the memory of the video. I checked in the network panel that when the video is inserted back again, the actual video is not requested again to the server, and it is played again with no...
  11. H

    JavaScript Free memory of HTMLVideoElement

    Then, how can I check if the memory of the video was freed?
  12. H

    JavaScript Free memory of HTMLVideoElement

    Is there anyway I can mark this thread as solved?
  13. H

    JavaScript Free memory of HTMLVideoElement

    Hello, and thanks for your reply! The 'remove' method is inherited from Element, so it is available also in HTMLVideoElement. I also read the thread you mentioned, but I was not sure if the memory would be freed just by setting the src to "". But it seems so. Also, my approach would work as I...
  14. H

    JavaScript Free memory of HTMLVideoElement

    Hello there! I have a page with a lot of videos, so memory is a concern. Because of that, I have implemented an Intersection Observer that removes the videos that are out of the viewport. This is the instruction: video.remove(); Where 'video' is an HTMLVideoElement. Will that instruction be...
  15. H

    Grid item with aspect-ratio

    @Jo Thank you so much for your response! Here is a screenshot of what I want to achieve: The first grid item is an image, and the second is text. I called the second one 'dominant' because I want it to dictate the height of the grid item, and I want the image to be an square image. So as...
  16. H

    Grid item with aspect-ratio

    Hello there! The problem I want to solve is in this codepen: https://codepen.io/hebrerillo/pen/rNbLXaR As you can see, the second grid item overlaps the first item, even though the first item has a specific width and height. Why?? Thank you so much!
  17. H

    Sass class with class specification using BEM

    Hello there! What I am going to ask is probably very easy, but I did not manage to get it even after so much search. This is the HTML: <form class='form-component'> <div class='form-component__row'></div> <div class='form-component__row...
  18. H

    JavaScript Can't read newURL property on Event in TypeScript

    Hello there! I am trying to catch the 'onHashChange' event in TypeScript and to work with the new URL. Here is the code: window.addEventListener('hashchange', function(event: HashChangeEvent) { console.log(event); }); However, the compiler gives this error: No overload matches...
  19. H

    HTML & CSS Can't center a grid item with a max-width

    Hello OldMan! Here is the entire code: <!DOCTYPE html> <html> <head> <style> .container { display: grid; height: 300px; background-color: antiquewhite; align-items: end; } .item {...
  20. H

    HTML & CSS Can't center a grid item with a max-width

    Hello Menator, I came up with a solution: https://codepen.io/hebrerillo/pen/xxWYvqZ But I am still wondering why grid items with a maximum width cannot be centered...
Back
Top Bottom