Open tised opened 3 years ago
Hello @tised do you experience this with your app or with the demo project?
It happens when widget.videoLoader.state = LoadState.success but controller is not initialized. For LoadState.loading it shows Loader, but in other cases, it shows the message.
Hello @blackmann "Media failed to load." text show in the demo project. Do you have any suggestions?, thanks
This is happening in case the video loader state is in state LoadState.success
and playerController!.value.isInitialized
still equals false
.
A quick and dirty workaround is to change line 117 in story_video.dart
(https://github.com/blackmann/story_view/blob/master/lib/widgets/story_video.dart#L117)
from:
return widget.videoLoader.state == LoadState.loading
to:
return widget.videoLoader.state == LoadState.loading || widget.videoLoader.state == LoadState.success
This will result in the loading spinner being shown for a split second instead of the error text. Note that that's not a proper fix.
I've made PR #121 that replicates Instagram's story switching which is just a brief black screen when the following video is loaded to allow for minimally invasive cuts between continuous video.
errorWidget: Container( color: Colors.black, width: MediaQuery.sizeOf(context).width, height: MediaQuery.sizeOf(context).height, ),
Adding this to StoryItem might be another alternative
When switching between cached videos already(tap on left-right edge), label "Media failed to load." appear for a split second