PlatformException(VideoError, Video player has error..)

问题描述

我有这个方法

Future<void> uploadVideo(BuildContext context) async {
  File videoFile = widget.videoFile;
  print("videoFile $videoFile"); //this gives: File: '/data/user/0/com.---/app_flutter/tutorVideo/1610097782457.mp4'
  setState(() {
    isLoading = true;
  });

  StorageReference fileStorageReference = FirebaseStorage.instance
      .ref()
      .child('tutorDetails')
      .child(AuthModel().currentUser.uid)
      .child('Video')
      .child(basename(videoFile.path));

  print("storage ${fileStorageReference.path}"); //this gives: storage tutorDetails/Kb2BmJnNWnMjxartXoXcmZGRjxg2/Video/1610097782457.mp4

  StorageUploadTask uploadTask = fileStorageReference.putFile(videoFile);

  StorageTaskSnapshot taskSnapshot = await uploadTask.onComplete;

  String downloadUrl = await taskSnapshot.ref.getDownloadURL();

  UserModel().updateProfileFields({
    'videoUrl': downloadUrl,"tutorApplicationVideoFlag": true,});

  setState(() {
    isLoading = false;
  });

  Navigator.popUntil(
      context,ModalRoute.withName(TutorApplicationScreen.path));
}

我正在使用最新版本的 video_player flutter 插件{我更新了它},但我遇到了这些错误

播放错误

未处理的异常:PlatformException(VideoError,Video player has error com.google.android.exoplayer2.ExoPlaybackException:源错误,空,空)

未处理的异常:'package:firebase_storage/src/storage_reference.dart':断言失败:第 62 行 pos 12:'file.existsSync()':不正确。

注意:它在某些设备上正常工作并且没有任何错误,但在其他设备上没有。有什么想法吗?谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)