Skip to content

Commit

Permalink
fix: Fix VideoViewControllerBaseMixin state in-correct issue
Browse files Browse the repository at this point in the history
  • Loading branch information
littleGnAl committed Jul 28, 2023
1 parent f50c4e4 commit 10038b8
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions lib/src/impl/video_view_controller_impl.dart
Expand Up @@ -46,9 +46,6 @@ extension VideoViewControllerBaseExt on VideoViewControllerBase {
mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {
int _textureId = kTextureNotInit;

bool _isCreatedRender = false;
bool _isDisposeRender = false;

@internal
bool get isInitialzed => (rtcEngine as RtcEngineImpl).isInitialzed;

Expand All @@ -72,14 +69,10 @@ mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {
assert(oldController is VideoViewControllerBaseMixin);
final oldControllerMixin = oldController as VideoViewControllerBaseMixin;
_textureId = oldControllerMixin.getTextureId();
_isCreatedRender = oldControllerMixin._isCreatedRender;
_isDisposeRender = oldControllerMixin._isDisposeRender;
}

@override
Future<void> dispose() async {
_isDisposeRender = true;
_isCreatedRender = false;
}

@protected
Expand Down Expand Up @@ -120,12 +113,6 @@ mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {
@internal
@override
Future<void> disposeRender() async {
if (!_isCreatedRender || _isDisposeRender) {
return;
}
_isDisposeRender = true;
_isCreatedRender = false;

await disposeRenderInternal();
}

Expand All @@ -141,9 +128,6 @@ mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {
return kTextureNotInit;
}

if (_isCreatedRender) {
return _textureId;
}
final textureId =
await rtcEngine.globalVideoViewController!.createTextureRender(
uid,
Expand All @@ -152,9 +136,6 @@ mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {
videoViewSetupMode,
);

_isCreatedRender = true;
_isDisposeRender = false;

return textureId;
}

Expand Down Expand Up @@ -205,14 +186,7 @@ mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {

@override
Future<void> setupView(int nativeViewPtr) async {
if (_isCreatedRender) {
return;
}

await setupNativeViewInternal(nativeViewPtr);

_isCreatedRender = true;
_isDisposeRender = false;
}

Future<void> dePlatformRenderRef(int platformViewId) async {
Expand Down

0 comments on commit 10038b8

Please sign in to comment.