Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stream closing when computer sleeps #67

Merged
merged 2 commits into from
Apr 5, 2024
Merged

Fix stream closing when computer sleeps #67

merged 2 commits into from
Apr 5, 2024

Conversation

jakub-gonet
Copy link
Member

@jakub-gonet jakub-gonet commented Apr 3, 2024

We use <img> tag to display MJPEG stream of simulator frames. It appears that after computer goes to sleep, connection between <img> and simulator server is dropped.

This change periodically tries to check if <img> contents is decodable and if not, remounts the image to establish a new connection.

Note: there's similar problem with Vite HMR server. It's easier to test this change by using production build.

Ref: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decode

Fixes #41.

Copy link

vercel bot commented Apr 3, 2024

@jakub-gonet is attempting to deploy a commit to the software-mansion Team on Vercel.

To accomplish this, @jakub-gonet needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.

We use <img> tag to display MJPEG stream of simulator frames.
It appears that after computer goes to sleep, connection between <img>
and simulator server is dropped.

This change periodically tries to check if <img> contents is decodable
and if not, remounts the image to establish a new connection.

Note: there's similar problem with Vite HMR server. It's easier to test this change
by using production build.

Ref: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decode
@jakub-gonet jakub-gonet merged commit 9856f51 into main Apr 5, 2024
1 check passed
@jakub-gonet jakub-gonet deleted the jgonet/sleep branch April 5, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IDE Panel goes blank some times after computer goes to sleep
2 participants