story_view icon indicating copy to clipboard operation
story_view copied to clipboard

"Media failed to load." appear for no reason

Open tised opened this issue 4 years ago • 6 comments

When switching between cached videos already(tap on left-right edge), label "Media failed to load." appear for a split second

tised avatar Apr 23 '21 13:04 tised

Hello @tised do you experience this with your app or with the demo project?

blackmann avatar Jun 26 '21 10:06 blackmann

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.

devashishpuri avatar Jul 03 '21 15:07 devashishpuri

Hello @blackmann "Media failed to load." text show in the demo project. Do you have any suggestions?, thanks

JosephChuang129 avatar Aug 02 '21 11:08 JosephChuang129

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.

christxph avatar Aug 19 '21 13:08 christxph

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.

bartonip avatar Sep 02 '21 03:09 bartonip