-
Notifications
You must be signed in to change notification settings - Fork 623
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
[Enhancement]: Remove a lot of providers from the Manifest. #123
Comments
@isabsent hello, sorry for commenting here. |
Hi! |
Thanks for your reply.
I'm getting data dynamically as array of bytes from an event. So how would
you proceed with it?
…On Sun, 9 Feb, 2020, 8:39 AM isabsent, ***@***.***> wrote:
Hi!
The answer you link is concerned with how to use ExoPlayer when you
haven't a source like byte[], File or ByteBuffer where random access to
the source is available. You have an InputStream (not FileInputStream or
ByteArrayInputStream) and want to play media from it. If you have a byte[]
as a source, the problem is disappear. What is a task you a trying to solve?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#123?email_source=notifications&email_token=AFVFLPWGXVRPTUJP7AXJZJLRB5XU7A5CNFSM4KLBVPG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELGBIFI#issuecomment-583799829>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFVFLPST5ENRVPAXFRPEAO3RB5XU7ANCNFSM4KLBVPGQ>
.
|
If you already have your data as a
Then, you can set above
|
Thanks, I will try this.
…On Sun, 9 Feb, 2020, 2:18 PM isabsent, ***@***.***> wrote:
If you already have your data as a byte[] to the moment you are going to
send it to ExoPlayer, you can envelop your byte[] in the
ByteArrayDataSource and create a MediaSource from it:
public MediaSource createMediaSourceFromByteArray(byte[] bytes) {
ByteArrayDataSource byteArrayDataSource = new ByteArrayDataSource(bytes);
DataSource.Factory factory = new DataSource.Factory() {
@OverRide
public DataSource createDataSource() {
return byteArrayDataSource;
}
};
MediaSource mediaSource = new ExtractorMediaSource.Factory(factory)
.setExtractorsFactory(new DefaultExtractorsFactory())
.createMediaSource(Uri.EMPTY);
return Objects.requireNonNull(mediaSource, "MediaSource cannot be null");
}
Then, you can set above MediaSource to ExopLayer:
MediaSource byteArrayMediaSource = createMediaSourceFromByteArray(bytes);
exoPlayer.prepare(byteArrayMediaSource);
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#123?email_source=notifications&email_token=AFVFLPTHD2IWL3VKBCHY3WDRB67N3A5CNFSM4KLBVPG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELGGLGQ#issuecomment-583820698>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFVFLPTH5DEI3VPZFW43YU3RB67N3ANCNFSM4KLBVPGQ>
.
|
You have a lot of 'provider
tags in
Manifest` as:with the only difference in
android:authorities="${applicationId}.nonmedia.documents"
. I suppose you can combine most of them under oneprovider
tag withspecifying all needed path in
file_provider_paths
.The text was updated successfully, but these errors were encountered: