albemala / native_video_player

A Flutter widget to play videos on iOS and Android using a native implementation.
MIT License
18 stars 13 forks source link

No content provider #19

Open tudosxxx opened 4 months ago

tudosxxx commented 4 months ago

Couldn't open /data/user/0/com.xxx.xxx/cache/SnapVid.Net_3241856401650611273.mp4: java.io.FileNotFoundException: No content provider: /data/user/0/com.xxx.xxx/cache/SnapVid.Net_3241856401650611273.mp4

I tested network and file and both reported the same error.

NativeVideoPlayerView( onViewReady: (controller) async {

                              videoControllers[index] = controller;
                              if(util.voice){
                                await videoControllers[index]!.setVolume(1);
                              }else{
                                await videoControllers[index]!.setVolume(0);
                              }
                              String path = await util.downLoad('${util.imageUrlHead}${widget.postWorkouts.url![index]!.url!}');
                              final videoSource = await VideoSource.init(
                                type: VideoSourceType.file,
                                path: path,
                              );
                              await videoControllers[index]!.loadVideoSource(videoSource);
                            },
                          )