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

772 after resuming app ios video displayed black #801

Merged
merged 3 commits into from
Jun 15, 2024

Conversation

BPerlakiH
Copy link
Collaborator

@BPerlakiH BPerlakiH commented Jun 9, 2024

Fixes: #772

Note: So far I only found this "hacky" javascript solution to fix this issue.
The traditional "low memory" warning triggers are not called in this case, therefore this black screen side effect is not due to that.
By playing and pausing the video (one after another) fixes this.
The fix is applied if:

  • we are not in picture in picture mode - here we do not have this problem
  • we are not at the beginning of the video - here we also do not have this problem, plus if we apply it as we come back to the tab., it will change the "poster" of the video to the first frame of the video (which might be black)

@BPerlakiH BPerlakiH linked an issue Jun 9, 2024 that may be closed by this pull request
@kelson42
Copy link
Contributor

kelson42 commented Jun 9, 2024

@BPerlakiH Any user visible side effect (beside the fix obviously)?

@BPerlakiH
Copy link
Collaborator Author

User impact: it is not fixing it immediately, there's a slight delay after re-opening the application, so the black screen is visible for a moment, after that it fixes the issue.

@kelson42
Copy link
Contributor

kelson42 commented Jun 9, 2024

@BPerlakiH There is way to trigger this earlier than ondisplay()? For example when the app gets out of hibernation?

@BPerlakiH
Copy link
Collaborator Author

BPerlakiH commented Jun 9, 2024

Actually, I had to wrap the call into a "Task" so it executes slightly later (next run loop), as the "black screen" problem appears somewhat later than "onAppear".

@kelson42
Copy link
Contributor

kelson42 commented Jun 9, 2024

Hmmm, I guess we can still do better. Video.js has a feature to set a "poster" overlay. Would that not be a solution to capture the frame a put it on the top, so, even if video goes black, this will be hidden in the background. See https://stackoverflow.com/questions/27583937/how-can-i-make-a-css-glass-blur-effect-work-for-an-overlay/27592975#27592975

@BPerlakiH BPerlakiH requested a review from benoit74 June 9, 2024 19:43
@BPerlakiH
Copy link
Collaborator Author

Yes, possibly we need further investigation why this is happening in the first place...
We have poster set at the start of the video, maybe we can use something similar.
I did checked the console output, but there are no errors no output whatsoever ever, when the video stops (eg. due to another streaming app).
Maybe there's a way to capture that moment in JS, and then we could do some fallback / overlay solution.

@kelson42
Copy link
Contributor

I'm not very satisfied from current PR. Lets talk about that later this week.

@kelson42 kelson42 force-pushed the 772-after-resuming-app-ios-video-displayed-black branch from 5fa5c8e to 0498c94 Compare June 15, 2024 05:23
@kelson42
Copy link
Contributor

I'm a bit surprised about this, but it seems there is no way tomdo better. Merging.

@kelson42 kelson42 merged commit 66100e4 into main Jun 15, 2024
4 checks passed
@kelson42 kelson42 deleted the 772-after-resuming-app-ios-video-displayed-black branch June 15, 2024 05:38
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.

After resuming app (iOS) video displayed black
2 participants