英文:
TrimViewer of video_trimmer plugin isn't displayed
问题
我正在使用 video_trimmer 插件,并尝试使应用程序能够裁剪视频。
我可以使用以下部分显示视频播放区域的小部件:
VideoViewer(trimmer: _trimmer)
然而,视频裁剪区域未显示。
TrimViewer(
trimmer: _trimmer,
viewerHeight: 50.0,
viewerWidth: MediaQuery.of(context).size.width,
maxVideoLength: const Duration(seconds: 10),
onChangeStart: (value) => _startValue = value,
onChangeEnd: (value) => _endValue = value,
onChangePlaybackState: (value) =>
setState(() => _isPlaying = value),
)
我将这些小部件放在 Column
小部件内,但 TrimViewer
被忽略。我找不到为什么这个小部件没有显示。
英文:
I'm using video_trimmer plugin and trying to make the app able to trim the videos.
I could show video playback area with the widget:
VideoViewer(trimmer: _trimmer)
However, video trimmer area wasn't displayed.
TrimViewer(
trimmer: _trimmer,
viewerHeight: 50.0,
viewerWidth: MediaQuery.of(context).size.width,
maxVideoLength: const Duration(seconds: 10),
onChangeStart: (value) => _startValue = value,
onChangeEnd: (value) => _endValue = value,
onChangePlaybackState: (value) =>
setState(() => _isPlaying = value),
)
I wrote these widgets inside of Column
widget, but TrimViewer
are ignored. I can't find why this widget is not displayed.
答案1
得分: 1
我已经使用一个Stateful widget 进行了管理,并在initState()
中加载了代码,但这更像是一种权宜之计,我希望为Trimmer实现状态管理。希望很快能有更好的解决方案。
final Trimmer _trimmer = Trimmer();
@override
void initState() {
super.initState();
_trimmer.loadVideo(videoFile: File(mediaFile.path));
}
英文:
I have managed it with a Stateful widget and loading the code on iniState() but its more as a workaround I would like to have a state management for the Trimmer. I hope there is a better solution soon.
final Trimmer _trimmer = Trimmer();
@override
void initState() {
super.initState();
_trimmer.loadVideo(videoFile: File(mediaFile.path));
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论