Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duration on web returns null (and breaks code) #24

Open
sunilguptasg opened this issue Mar 17, 2022 · 1 comment
Open

Duration on web returns null (and breaks code) #24

sunilguptasg opened this issue Mar 17, 2022 · 1 comment

Comments

@sunilguptasg
Copy link

Uint8List byteString = await pickedFile.readAsBytes(); <<pickedFile is XFile
Metadata videoMetaData = await MetadataRetriever.fromBytes(byteString);
int? dur = videoMetaData.trackDuration; << returns null

Note: I have added this script in the section of index.html

<script type="text/javascript" src="https://unpkg.com/mediainfo.js/dist/mediainfo.min.js"></script>

also the code crashes on this line
line 110 of flutter_media_metadata_web.dart:'albumArt': base64Decode(rawMetadataJson['Cover_Data']),

I'm basically struggling to get the duration of a picked video file on the web.

@alexmercerind
Copy link
Owner

Feel free to submit a fix. I never used web in any of my Flutter projects, it's just something I added to complete the set.
Other than that, I wouldn't use this to get duration, but official web audio or video APIs, primary purpose of this plugin is to read tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants