gpt4 book ai didi

flutter - 在 flutter 中添加 video_trimmer 后 better_player 停止工作

转载 作者:行者123 更新时间:2023-12-05 04:23:59 24 4
gpt4 key购买 nike

Better_Player 在添加 Video_Trimmer 之前工作,但在我添加 Video_Trimmer 后,它停止播放视频,如果我再次删除 Video_Trimmer,Better_Player 工作。

我测试的东西:

  1. 卸载并重新安装应用程序
  2. 使用较低版本的 Better_Player
better_player: ^0.0.83
video_trimmer: ^1.1.3

控制台错误是:

E/MethodChannel#better_player_channel(18557): Failed to handle method call
E/MethodChannel#better_player_channel(18557): java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider no longer handles null by instantiating a new DefaultDrmSessionManagerProvider. Explicitly construct and pass an instance in order to retain the old behavior.
E/MethodChannel#better_player_channel(18557): at com.google.android.exoplayer2.util.Assertions.checkNotNull(Assertions.java:174)
E/MethodChannel#better_player_channel(18557): at com.google.android.exoplayer2.source.ProgressiveMediaSource$Factory.setDrmSessionManagerProvider(ProgressiveMediaSource.java:186)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayer.buildMediaSource(BetterPlayer.kt:430)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayer.setDataSource(BetterPlayer.kt:196)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayerPlugin.setDataSource(BetterPlayerPlugin.kt:277)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:151)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:138)
E/MethodChannel#better_player_channel(18557): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/MethodChannel#better_player_channel(18557): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#better_player_channel(18557): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#better_player_channel(18557): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#better_player_channel(18557): at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#better_player_channel(18557): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#better_player_channel(18557): at android.os.Looper.loopOnce(Looper.java:210)
E/MethodChannel#better_player_channel(18557): at android.os.Looper.loop(Looper.java:299)
E/MethodChannel#better_player_channel(18557): at android.app.ActivityThread.main(ActivityThread.java:8273)
E/MethodChannel#better_player_channel(18557): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#better_player_channel(18557): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
E/MethodChannel#better_player_channel(18557): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073)
E/flutter (18557): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(error, MediaSource.Factory#setDrmSessionManagerProvider no longer handles null by instantiating a new DefaultDrmSessionManagerProvider. Explicitly construct and pass an instance in order to retain the old behavior., null, java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider no longer handles null by instantiating a new DefaultDrmSessionManagerProvider. Explicitly construct and pass an instance in order to retain the old behavior.
E/flutter (18557): at com.google.android.exoplayer2.util.Assertions.checkNotNull(Assertions.java:174)
E/flutter (18557): at com.google.android.exoplayer2.source.ProgressiveMediaSource$Factory.setDrmSessionManagerProvider(ProgressiveMediaSource.java:186)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayer.buildMediaSource(BetterPlayer.kt:430)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayer.setDataSource(BetterPlayer.kt:196)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayerPlugin.setDataSource(BetterPlayerPlugin.kt:277)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:151)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:138)
E/flutter (18557): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/flutter (18557): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (18557): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/flutter (18557): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (18557): at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (18557): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (18557): at android.os.Looper.loopOnce(Looper.java:210)
E/flutter (18557): at android.os.Looper.loop(Looper.java:299)
E/flutter (18557): at android.app.ActivityThread.main(ActivityThread.java:8273)
E/flutter (18557): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (18557): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
E/flutter (18557): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073)
E/flutter (18557): )
E/flutter (18557): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (18557): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557): #2 MethodChannelVideoPlayer.setDataSource (package:better_player/src/video_player/method_channel_video_player.dart:118:5)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557): #3 VideoPlayerController._setDataSource (package:better_player/src/video_player/video_player.dart:408:5)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557): #4 BetterPlayerController._setupDataSource (package:better_player/src/core/better_player_controller.dart:485:9)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557): #5 BetterPlayerController.setupDataSource (package:better_player/src/core/better_player_controller.dart:274:5)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557):
W/System (18557): A resource failed to call close.
I/BufferQueueProducer(18557): [SurfaceView[com.example.meetbin/com.example.meetbin.MainActivity]#5(BLAST Consumer)5](id:487d00000006,api:1,p:18557,c:18557) disconnect: api 1
I/BufferQueueProducer(18557): [SurfaceView[com.example.meetbin/com.example.meetbin.MainActivity]#5(BLAST Consumer)5](id:487d00000006,api:0,p:-1,c:18557) disconnect: api -1
I/BufferQueueProducer(18557): [ViewRootImpl[MainActivity]#4(BLAST Consumer)4](id:487d00000005,api:1,p:18557,c:18557) disconnect: api 1
I/BLASTBufferQueue(18557): [ViewRootImpl[MainActivity]#4] destructor()
I/BufferQueueConsumer(18557): [ViewRootImpl[MainActivity]#4(BLAST Consumer)4](id:487d00000005,api:0,p:-1,c:18557) disconnect
D/DecorView[](18557): onWindowFocusChanged hasWindowFocus false

最佳答案

我遇到了同样的问题,现在按照这个 #1085 解决了

要解决这个问题,只需使用这个 better_player 版本:

替换

better_player: ^0.0.83

通过

better_player:
git:
url: https://github.com/tintran-dev/betterplayer.git

还要确保你已经为 m3u8 和 mdp 添加了格式类型

BetterPlayerDataSource dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
"url",
videoFormat: BetterPlayerVideoFormat.hls,
drmConfiguration: BetterPlayerDrmConfiguration(
drmType: BetterPlayerDrmType.token,
token: "Bearer=token",
),
);

关于flutter - 在 flutter 中添加 video_trimmer 后 better_player 停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73587641/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com