-
Notifications
You must be signed in to change notification settings - Fork 47
fix(ui): Skia flickering fix on Android #1147
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7aaf8f5
cleaned up keys to distingush visibility detector between scopes
Brazol a6aae55
added android pip manager
Brazol 0b7bef5
update webrtc dependency
Brazol 41be56e
fixed dependencies
Brazol 9b866e1
Merge branch 'main' into fix/skia-pip-flickering
Brazol f88ed68
updated webrtc dependency
Brazol d6a2b13
Merge branch 'main' into fix/skia-pip-flickering
Brazol fe3da54
Merge branch 'main' into fix/skia-pip-flickering
Brazol df32e71
tweaks
Brazol 73322ac
webrtc version change
Brazol 4894e7d
Revert "webrtc version change"
Brazol a5a3489
Merge branch 'main' into fix/skia-pip-flickering
Brazol 89c9eae
webrtc bump
Brazol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...ideo_flutter/lib/src/call_screen/call_content/picture_in_picture/android_pip_manager.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import 'package:flutter/services.dart'; | ||
|
|
||
| import '../../../../stream_video_flutter.dart'; | ||
|
|
||
| class AndroidPipManager { | ||
| factory AndroidPipManager.instance() { | ||
| return _instance ??= AndroidPipManager._(); | ||
| } | ||
|
|
||
| AndroidPipManager._() { | ||
| _methodChannel.setMethodCallHandler(_handleMethodCall); | ||
| } | ||
|
|
||
| static const String _pipChannel = 'stream_video_flutter_android_pip'; | ||
| static const MethodChannel _methodChannel = MethodChannel(_pipChannel); | ||
|
|
||
| static AndroidPipManager? _instance; | ||
|
|
||
| final _logger = taggedLogger(tag: 'SV:AndroidPipManager'); | ||
|
|
||
| final List<ValueChanged<bool>> _onPictureInPictureModeChangedListeners = []; | ||
|
|
||
| bool _isInPictureInPictureMode = false; | ||
| bool get isInPictureInPictureMode => _isInPictureInPictureMode; | ||
|
|
||
| void addOnPictureInPictureModeChangedListener(ValueChanged<bool> listener) { | ||
| _onPictureInPictureModeChangedListeners.add(listener); | ||
| } | ||
|
|
||
| void removeOnPictureInPictureModeChangedListener( | ||
| ValueChanged<bool> listener, | ||
| ) { | ||
| _onPictureInPictureModeChangedListeners.remove(listener); | ||
| } | ||
|
|
||
| /// Updates the Android side about whether PiP should be allowed based on current call state | ||
| Future<void> setPictureInPictureAllowed(bool isAllowed) async { | ||
| if (!CurrentPlatform.isAndroid) return; | ||
|
|
||
| try { | ||
| await _methodChannel.invokeMethod( | ||
| 'setPictureInPictureAllowed', | ||
| isAllowed, | ||
| ); | ||
| } catch (e) { | ||
| _logger.e( | ||
| () => | ||
| '[_setPictureInPictureAllowed] Failed to set picture in picture allowed: $e', | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| Future<void> _handleMethodCall(MethodCall call) async { | ||
| switch (call.method) { | ||
| case 'onPictureInPictureModeChanged': | ||
| final isInPictureInPictureMode = call.arguments as bool; | ||
| _isInPictureInPictureMode = isInPictureInPictureMode; | ||
|
|
||
| for (final listener in _onPictureInPictureModeChangedListeners) { | ||
| listener(isInPictureInPictureMode); | ||
| } | ||
|
|
||
| break; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.