Closed BTMuli closed 2 weeks ago
It is so strange that it works well in profile mode but got wrong under release.🤔
your problem is that video is not loaded before you seek check this for possible fixes https://github.com/media-kit/media-kit/issues/228
for me i use
await player.stream.buffer.first;
your code will be
await player.open(Playlist(hive.allMedia, index: hive.index), play: play);
await player.stream.buffer.first;
var progress = hive.getProgress(index);
if (progress != 0) {
debugPrint('跳转到上次播放进度: $progress');
await player.seek(Duration(milliseconds: progress));
// Here's a custom snackbar widget
await Infobar(context, '已跳转到上次播放进度 $progress');
}
for me it works correctly.
await player.stream.buffer.first;
Thanks,I'll try it,but why I could seek directly in profile mode?
i think because the video was cached? thats the only thing i could think of
Thanks!await player.stream.buffer.first;
really works.
I use the code below:
And it runs normally in debugMode and profileMode,but when I bundle my app in release,it show the snackbar but the video play from 0 instead of jump to the true position.