0

I'm loading once-viewable video players into iframes and encountering a spurious problem in which we occasionally get errors from the video provider, saying the link has already been used.

I am still trying to completely prove to myself that I'm not accidentally deleting and reinserting the iframe, but meanwhile I need to ask the community:

Is there any circumstance under which the an iframe might reload its src and if so, what event should I be listening for, in order to detect this?

thank you!

Tyler Gannon
  • 872
  • 6
  • 19
  • 1
    I can't think of anything that would do it spontaneously, but assigning to `.src` would do it. – Barmar Feb 12 '21 at 19:19
  • One thing that could happen is that browsers will try to fetch the video through Range requests, to avoid having to fetch everything in one shot and allow faster seeking in the media. If the server really can't accept two requests to the same URL, then this might cause an issue since the first request is generally very small only to check if the server can handle Range requests. – Kaiido Feb 13 '21 at 12:22

1 Answers1

1

According to this answer,
You can use iframe.contentWindow.location.reload(); to reload the iframe.

m24197
  • 1,038
  • 1
  • 4
  • 12