尝试优化多层弹幕所占资源
This commit is contained in:
@ -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),
|
||||||
),
|
),
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user