Skip to content

Commit 96ff41c

Browse files
committed
enable mediacodec_embed for android
1 parent 1811e17 commit 96ff41c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/pages/player/player_controller.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,16 @@ abstract class _PlayerController with Store {
8484

8585
videoController = VideoController(
8686
mediaPlayer,
87-
configuration: VideoControllerConfiguration(
88-
enableHardwareAcceleration: hAenable,
89-
androidAttachSurfaceAfterVideoParameters: false,
90-
),
87+
configuration: (Platform.isAndroid && hAenable)
88+
? const VideoControllerConfiguration(
89+
vo: 'mediacodec_embed',
90+
hwdec: 'mediacodec',
91+
androidAttachSurfaceAfterVideoParameters: false,
92+
)
93+
: VideoControllerConfiguration(
94+
enableHardwareAcceleration: hAenable,
95+
androidAttachSurfaceAfterVideoParameters: false,
96+
),
9197
);
9298
mediaPlayer.setPlaylistMode(PlaylistMode.none);
9399

0 commit comments

Comments
 (0)