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

Read my own music from cloud #19

Closed
shuaibidshuaib opened this issue Oct 3, 2021 · 3 comments
Closed

Read my own music from cloud #19

shuaibidshuaib opened this issue Oct 3, 2021 · 3 comments

Comments

@shuaibidshuaib
Copy link

Pls sir help me im kind of newbie to flutter, i want the app to display my own music from cloud instead of yours pls how can i do that, i saw that u use firebase , pls assist me . I working on a school project and i need to submit it .

@iamAbhishekkumar
Copy link
Owner

iamAbhishekkumar commented Oct 3, 2021

Your own music? If you mean, the songs which are locally present. Then this would be helpful, since just_audio is itself using audio players, so you can try to load your file as follows :

Future _loadFile() async {
    final bytes = await readBytes(Uri.parse(kUrl1));
    final dir = await getApplicationDocumentsDirectory();
    final file = File('${dir.path}/audio.mp3');

    await file.writeAsBytes(bytes);
    if (file.existsSync()) {
      setState(() => localFilePath = file.path);
    }
  }

@shuaibidshuaib
Copy link
Author

shuaibidshuaib commented Oct 5, 2021 via email

@shuaibidshuaib
Copy link
Author

shuaibidshuaib commented Oct 5, 2021 via email

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