TrimViewer插件的视频修剪器未显示。

huangapple go评论70阅读模式
英文:

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));
}

huangapple
  • 本文由 发表于 2023年2月10日 02:39:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75403059.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定