Hi!
I have a simple livecomponent in a modal that opens an mjpeg stream in an img tag as follows:
defmodule MyWeb.CamLive.PreviewComponent do
use MyWeb, :live_component
@impl true
def render(assigns) do
~H"""
<div>
<.header>
<%= @title %>
</.header>
<img src={"/preview/#{@cam.id}"}/>
</div>
"""
end
end
When I close the modal, I see that the socket of the mjpeg stream is not closed - until i refresh my page.
I have found a workaround to instead of an img tag, use an iframe … but i’d like to not use iframes.
Hope someone knows of a proper solution of doing this ? thanks !