Skip to content

Include no_sleep.js only on web builds - #142

Open
DublikuntMux wants to merge 3 commits into
fluttercommunity:mainfrom
DublikuntMux:main
Open

Include no_sleep.js only on web builds#142
DublikuntMux wants to merge 3 commits into
fluttercommunity:mainfrom
DublikuntMux:main

Conversation

@DublikuntMux

Copy link
Copy Markdown

Description

Include no_sleep.js only on web platform build as it realy need only for it.

diegotori
diegotori previously approved these changes Jul 28, 2026

@diegotori diegotori left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@DublikuntMux DublikuntMux left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some future investigation on web build i find that:
Flutter currently supports safari 15.6 and newer, while safari added native Screen Wake Lock support in version 16.4.
This leaves safari 15.6-16.3 within flutter supported browser range but without native Screen Wake Lock support. The video fallback is therefore still required to preserve compatibility with flutter current minimum browser versions.
Previously all browsers downloaded and parsed fallback js and its embedded video data, including browsers that support the native api.
So i propose:
Legacy video based fallback is load only in browsers that not expose navigator.wakeLock. Fallback media is also move out of js source into separate assets, avoiding the embedded base64 payload in modern browsers.

@DublikuntMux DublikuntMux left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also in future when flutter drop support of old safari remove this:

  • no_sleep.js
  • fallback videos
  • js loader
  • fallback js interop layer

@diegotori

Copy link
Copy Markdown
Collaborator

@DublikuntMux the latest changes made to your PR are completely separate from the original version.

Please create a separate PR with those changes instead of polluting this one. Thanks.

@diegotori
diegotori dismissed their stale review July 29, 2026 21:12

Please return this PR back to its original state, where it focused on one issue, instead of trying to slip non-pertinent changes into it. Thanks.

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.

2 participants