我不确定这是不是
flutter
Firebase Storage
.
我用iPhone的肖像模式拍摄了视频并上传到
火基存储器
我上传视频并像这样播放。
Future _upload(File file) async {
try {
String now = DateTime.now().millisecondsSinceEpoch.toString();
String storageId = (now + uid);
String contentType = 'video/mp4';
StorageReference ref = FirebaseStorage.instance.ref().child("video").child(storageId);
StorageUploadTask uploadTask = ref.putFile(file, StorageMetadata(contentType: contentType));
Uri downloadUrl = (await uploadTask.future).downloadUrl;
String url = downloadUrl.toString();
print(url);
} catch (error) {
print(error);
}
}
VideoPlayerController _controller;
new AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: new VideoPlayer(_controller)
)
有人知道怎么解决这个问题吗?