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

Did Media change from .0.0.2? #10

Closed
syleishere opened this issue Apr 3, 2021 · 7 comments
Closed

Did Media change from .0.0.2? #10

syleishere opened this issue Apr 3, 2021 · 7 comments
Labels
question Further information is requested

Comments

@syleishere
Copy link

syleishere commented Apr 3, 2021

I had:
List<Media> medias = <Media>[];
then:
medias.add(Media.file(new File(fileSystemEntity.path)));
now its breaking on .3 and .4 versions.

@alexmercerind
Copy link
Owner

Now you need to add await, as there are new metadata parsing features in Media.

@alexmercerind alexmercerind added the question Further information is requested label Apr 4, 2021
@syleishere
Copy link
Author

syleishere commented Apr 4, 2021

I did have an await, I added it back, same thing, doesn't work:
await medias.add(Media.file(new File(fileSystemEntity.path)));

@alexmercerind
Copy link
Owner

alexmercerind commented Apr 4, 2021

Write this:

medias.add(await Media.file(new File(fileSystemEntity.path)));

See examples in README

@syleishere
Copy link
Author

Oww crap this worked though:
await medias.add(await Media.file(new File(fileSystemEntity.path)));

@alexmercerind
Copy link
Owner

Same is documented in README. I make sure to update the examples.

@syleishere
Copy link
Author

Alright, I can stay on .0.0.4, I'm happy thankyou.

@syleishere
Copy link
Author

syleishere commented Apr 4, 2021

On a side note if you are trying to make similar to audio assets: here is the difference between what you have and what they have so far:

import 'package:dart_vlc/dart_vlc.dart';
import 'package:assets_audio_player/assets_audio_player.dart' as myaudio;

FOR DART VLC:
await medias.add(await Media.file(new File(fileSystemEntity.path)));
FOR AUDIO ASSETS:
await medias2.add(myaudio.Audio.file(fileSystemEntity.path));

Just wondering if done on purpose?

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

No branches or pull requests

2 participants