公司有個專案,需要用獲取相冊中圖片視頻的拍攝時間和檔案大小,但是用flutter寫的話只能獲取到視頻和圖片,沒有辦法獲取到更詳細的資訊,不知道有沒有大佬可以解決這個問題
uj5u.com熱心網友回復:
VideoPlayerController _controller; //視頻播放器ImagePicker.pickVideo(source: source).then((File f) async {
if (f != null) {
_controller = VideoPlayerController.file(f);
_controller.initialize().then((val){
_controller.setLooping(true);
int seconds = _controller.value.duration.inSeconds;
print("視頻時長:$seconds");
int fileSize=f.lengthSync();//單位B
print("視頻大小:${fileSize}");
});
}
});
等視頻播放器 初始完后就可以獲取視頻時間,
uj5u.com熱心網友回復:
你好 怎么播放本地的視頻?轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/83192.html
標籤:移動開發其他問題
