Skip to content

Commit

Permalink
fix when reuse the same MediaPlayerController, the new AgoraVieoView …
Browse files Browse the repository at this point in the history
…not be shown after MediaPlayerController.disposeRender
  • Loading branch information
littleGnAl committed Apr 4, 2023
1 parent 0e904e1 commit 42b3d7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/src/impl/media_player_controller_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class MediaPlayerControllerImpl
@override
Future<int> createTextureRender(
int uid, String channelId, int videoSourceType) {
return rtcEngine.globalVideoViewController.createTextureRender(
return super.createTextureRender(
getMediaPlayerId(),
channelId,
videoSourceType,
Expand All @@ -373,7 +373,7 @@ class MediaPlayerControllerImpl
@override
Future<void> disposeRenderInternal() async {
if (shouldUseFlutterTexture) {
await super.disposeRender();
await super.disposeRenderInternal();
}
}
}
3 changes: 2 additions & 1 deletion lib/src/impl/video_view_controller_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {
int videoSourceType,
) async {
if (_isCreatedRender) {
return kTextureNotInit;
return _textureId;
}
final textureId =
await rtcEngine.globalVideoViewController.createTextureRender(
Expand All @@ -138,6 +138,7 @@ mixin VideoViewControllerBaseMixin implements VideoViewControllerBase {
);

_isCreatedRender = true;
_isDisposeRender = false;

return textureId;
}
Expand Down

0 comments on commit 42b3d7c

Please sign in to comment.