info: fixed missing metadata for some videos and multitrack HEIC

This commit is contained in:
Thibault Deckers 2021-04-21 11:34:37 +09:00
parent 492d9964ad
commit 8d1ab77aa9

View file

@ -33,8 +33,12 @@ class VideoMetadataFormatter {
static Future<Map> getVideoMetadata(AvesEntry entry) async {
final player = FijkPlayer();
await player.setDataSourceUntilPrepared(entry.uri);
final info = await player.getInfo();
final info = await player.setDataSourceUntilPrepared(entry.uri).then((v) {
return player.getInfo();
}).catchError((error) {
debugPrint('failed to get video metadata for entry=$entry, error=$error');
return {};
});
await player.release();
return info;
}