尝试优化多层弹幕所占资源

This commit is contained in:
orz12
2024-01-09 15:52:22 +08:00
parent 449aa69033
commit c9fd6304fd
2 changed files with 4 additions and 2 deletions

View File

@ -125,7 +125,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
duration: const Duration(milliseconds: 100), duration: const Duration(milliseconds: 100),
child: DanmakuView( child: DanmakuView(
createdController: (DanmakuController e) async { createdController: (DanmakuController e) async {
widget.playerController.danmakuController = _controller = e; playerController.danmakuController = _controller = e;
}, },
option: DanmakuOption( option: DanmakuOption(
fontSize: 15 * fontSizeVal, fontSize: 15 * fontSizeVal,
@ -135,7 +135,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
hideScroll: blockTypes.contains(2), hideScroll: blockTypes.contains(2),
hideBottom: blockTypes.contains(4), hideBottom: blockTypes.contains(4),
duration: duration:
danmakuDurationVal / widget.playerController.playbackSpeed, danmakuDurationVal / playerController.playbackSpeed,
// initDuration / // initDuration /
// (danmakuSpeedVal * widget.playerController.playbackSpeed), // (danmakuSpeedVal * widget.playerController.playbackSpeed),
), ),

View File

@ -213,6 +213,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
videoIntroController.isPaused = true; videoIntroController.isPaused = true;
plPlayerController!.removeStatusLister(playerListener); plPlayerController!.removeStatusLister(playerListener);
plPlayerController!.pause(); plPlayerController!.pause();
plPlayerController!.danmakuController?.pause();
plPlayerController!.danmakuController?.clear();
} }
super.didPushNext(); super.didPushNext();
} }