-
Notifications
You must be signed in to change notification settings - Fork 4
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
Prevent mobile browsers from sleeping during transfer #125
Conversation
I have tested on iOS (16.2), but it didn't work, phone still went sleep. However, I see there is PR which is fixing iOS problem: richtr/NoSleep.js#138, I will try with it. Still not working with. JS error:
Seems repo https://github.com/richtr/NoSleep.js abandoned by owner and a lot of PR hanging without merge. |
Seems Safari (webkit) requires |
Seems plugin example works on iOS: https://richtr.github.io/NoSleep.js/example. So maybe issue on our side? |
@donpui I'm unable to check the problem since I don't own any ios device. It works on my android device though. All I can guess is that video playback is being blocked, but I can't test it |
We can pair and experiment together. In NoSleep.js documentation, there is saying: |
@donpui Since ios blocks video playback if not tied to user input, I have changed nosleep so that it activates on button presses. I tested the following scenarios on android and it works, hopefully it works on ios as well.
|
This reverts commit 6f2f747.
Tested on iOS device with Safari, Chrome, Firefox:
NoSleeps works for mobile devices, should check mobile browsers/device and do not enable/disable wakelock. Or do we leave for nosleep package to take care? |
Several concerns, which we might need to think:
|
Since our testing seems to show that it works on the common mobile os (Android, iOS) and browsers (Safari, Chrome, Firefox), I think this pr is ok to merge, maybe after adding some tests. If we find any issues, we can review the existing forks to use or make our own if needed. We don't have any setup for automated e2e for mobile devices, but I can add integration tests that can check the NoSleep state |
Lets add at least integration test. |
Copying my message here (TL;DR we'll hold off adding the tests for now: #128)
|
Adding to this, we would very much also need E2E running on real devices, issue: #106. As even if we test states and activation, we are not fully sure if it works for end users. For example WakeLock API is very differently supported via different browsers and in some case workarounds are implemented inside library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the rest things looks ok. Improvement is important for mobile devices users.
Ref: #120