Closed Jeremiah104 closed 4 years ago
Hello, can you let me know the audio file url for test? thanks
I have read your post on upwork. so I send this message to you here
Hi thanks for responding, The url is https://moc-app-test.s3.amazonaws.com/audios/test.mp3.
The audio file URL is inaccessible because you need the authentication headers. This is the goal of my question here - I need to be able to add S3 authentication headers to this package so that I can access and stream a non public file. (I am using https://github.com/diagnosia/flutter_aws_s3_client to generate the header info)
Hi, can you provide AWS S3 key for me to test?
Yeah I just don't want to post that publicly, what is your Upwork name/id? We can talk there and I can get you the keys.
ok, then let's discuss via skype my skype id is live:fc722aec9c3a7bb4 please let you send message with secure rar file via skype.
Hi @Jeremiah104 and @shipofsea
Is there a reason why the issue is now closed?
This is a useful feature of benefit to the larger user base and I was going to work on it, but I wasn't sure if @shipofsea had started working on it and didn't want to interfere with that particularly if it was being done through upwork or some other arrangement.
Note that there is now a pull request that implements this feature by @raveesh-me here: #107 , which provides guidance on how such a feature could be added.
Since @Jeremiah104 closed this issue without a solution being added to the repo, please track the new open issue #105 (which is essentially the same) if you are still interested in this feature, and I will do an implementation based on @raveesh-me 's suggestions.
Hi @ryanheise This was done by Cookytech team on Upwork. @Jeremiah104 is using a fork of our fork of your project, and we decided to send a pull request to share the results with you.
Hi @ryanheise, Sorry about that lack of communication from me. @raveesh-me has solved the problem for me and I have been using their fork of the repository and it has been working great.
@Jeremiah104 Have you guys figured out how to generate and pass headers dynamically? I'm working on HLS Audio player and need to create header (SigV4) per file from S3.
@BartusZak
I've written API documentation for every method and constructor in this plugin and I'm sure that if you read the API documentation for whichever method you're using, you will either find the answer to your question, or you will at least be in a position to submit a documentation request so that I can clear up any confusing documentation.
AudioSource.uri allows you to pass headers. I stream from s3 doing something similar. In my case I need to pass a cookie to the server and if the cookie is valid, the server will redirect to a presigned time-based s3 url to stream the media. From the UI side you can use MediaItem extras to pass along header information and within your player task extract headers from extras and use with AudioSource.uri. Last I looked I think setUrl was a shortcut for AudioSource.uri and setUrl also allows you to pass headers.
Well that's certainly a much more helpful response than mine :-) But in my defence, I am more concerned with using GitHub for project development and using StackOverflow for community support. It's a bit overwhelming to manage otherwise.
To that end, let's keep these GitHub pages focused on the improvement and development of the plugin. In what ways can the documentation be improved (@BartusZak ?)
As for the question, it has actually been asked and answered on StackOverflow, but I am concerned that if someone really needs to ask that question, I can do a better job of the documentation.
Hey @defsub and @ryanheise
So sorry for late reply. We had a pause on that requirement.
What I ends up doing (trying):
TLDR: Public Access works perfectly on
WEB
but produces some errors/warnings onAndorid
. Private S3 Bucket does not work either onWEB
orAndroid
.
(works on WEB and Android - producess warnings? )
ConcatenatingAudioSource _playlist = ConcatenatingAudioSource(children: [
AudioSource.uri(
Uri.parse(
"https://bartuszak-full-public.s3-eu-west-1.amazonaws.com/boska-komedia-czysciec_001_czysciec-piesn-pierwsza.mp3"),
tag: AudioMetadata(
title: "Public access TEST",
artwork:
"https://zak-dev-public-access-bucket.s3-eu-west-1.amazonaws.com/audiobooks/Boska_Komedia/boska-komedia-icon.jpg"),
),
]);
(sigV4 headers required)
_playlist.add(AudioSource.uri(
Uri.parse(
"https://zak-dev-user-access-bucket/all-access/audiobooks/Boska_Komedia/boska-komedia-czysciec_001_czysciec-piesn-pierwsza.mp3"),
headers: _s3Repository.generateSignedHeaders(
"https://zak-dev-user-access-bucket/all-access/audiobooks/Boska_Komedia/boska-komedia-czysciec_001_czysciec-piesn-pierwsza.mp3"),
tag: AudioMetadata(
title: widget.audiobook.content[0].title,
artwork:
"https://zak-dev-public-access-bucket.s3-eu-west-1.amazonaws.com/audiobooks/Boska_Komedia/boska-komedia-icon.jpg"),
));
(not supported) - ok, can we support it?
Flutter 1.26.0-17.6.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision a29104a69b (11 days ago) • 2021-02-16 09:26:56 -0800
Engine • revision 21fa8bb99e
Tools • Dart 2.12.0 (build 2.12.0-259.12.beta)
just_audio: ^0.6.14+1
I/CCodecConfig( 5542): query failed after returning 7 values (BAD_INDEX)
Sounds like an Exoplayer issue. After searching for the error message I found this:
https://github.com/google/ExoPlayer/issues/6397
Note the comments about the encoding (if it is within your control, you could try a different encoding)
Cleartext HTTP traffic to 127.0.0.1 not permitted
This is because headers are supported through the use of a clear text proxy running on the device. In recent versions of Android, it is now required to add the cleartext option to your manifest (search the README for cleartext). But see also this discussion if you want to secure the proxy. (If you need to do that, there is now a way to hook into the proxy using StreamAudioSource
).
Hey @ryanheise
Adding that to AndroidManifest.xml
removed Cleartext HTTP traffic to 127.0.0.1 not permitted
error.
<application ... android:usesCleartextTraffic="true">
What left
Player works! It loooks like those are info logs and ExoPlayer
logs level is preatty high. I don't know If I should leave it for now.
What can I do for you to help with WEB
support for generated headers
?
For WEB it gives: An error occured NoSuchMethodError: invalid member on null: 'addUriAudioSource'
For web, what's required is service workers support in Flutter. There is the service_worker package but that doesn't appear to have Flutter support. That would require integration with Flutter's build process, so support would need to be built into Flutter itself.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.
Hi I am new to flutter and I am trying to stream an audio file from amazon s3, this package seems to be able to do everything I need when I use a public link but I need to access a link that uses headers for authentication and I can't find where to add headers.
I'm not sure if there is a simple solution to this that I am unaware of, or if it is a functionality that would need to be added.