Am trying to figure out if/how to replace DefaultHttpDataSource with OkHttpDataSource
Was trying to evaluate the Okhttp for performance and other usecases.
Checkout my branch which use OkHttp 2.x
https://github.com/b95505017/ExoPlayer/tree/okhttp_http_data_source
I'll upgrade to 3.x after Facebook's Stetho supporting OkHttp 3.x.
thanks this works great, any plans to submit this as a PR
I'm unclear as to why you don't just take the existing demo app and replace each instantiation of DefaultUriDataSource so that instead of this:
DataSource dataSource = new DefaultUriDataSource(context, bandwidthMeter, userAgent);
You have this:
DataSource dataSource = new DefaultUriDataSource(context, bandwidthMeter,
new OkHttpDataSource(okHttpClient, userAgent, null, bandwidthMeter));
Is it just a matter of documenting this more clearly somewhere?
I'm too stupid...... You're right.
@biodatacomp check this out
https://github.com/google/ExoPlayer/pull/735#issuecomment-133878962
That's why I didn't submit as PR. :)
Let's use this issue to track adding documentation to the corresponding Readme file.
@biodatacomp I've force update my branch to match up with ExoPlayer 1.5.4, including OkHttp3 & Stetho.
I see that OkHttpDataSource is included with the source code but I'm a bit confused about how to get it via a normal dependency like e.g. compile 'com.google.android.exoplayer:extension-okhttp:r1.5.6'. It seems like that is not possible at the moment?
I'm asking for this approach since I think it works nicely for e.g. Glide by using compile 'com.github.bumptech.glide:okhttp-integration:1.4.0@aar'.
This enhancement is tracking:
In theory it should now be possible to include the OkHttp extension for V2 with:
compile 'com.google.android.exoplayer:extension-okhttp:r2.0.1'
Bintray link here. This doesn't seem to work for me at the moment. I'm unclear whether there's just a propagation delay in it being indexed, or whether something else is wrong. If anyone has any ideas, please let me know!
Could not find ExoPlayer:library:unspecified.
Caused by
<dependency>
<groupId>ExoPlayer</groupId>
<artifactId>library</artifactId>
<version>unspecified</version>
<scope>runtime</scope>
</dependency>
Yeah. Hence the "This doesn't seem to work for me at the moment" part...!
The path should be the jCenter one
<dependency>
<groupId>com.google.android.exoplayer</groupId>
<artifactId>exoplayer</artifactId>
<version>r2.0.1</version>
</dependency>
I don't really understand what you mean. Have you spotted an error? If so, please clarify exactly what it is.
Ah, I see the problem now. I'm not entirely sure how to fix how that gets generated as part of the release process, but will take a look.
Yes, we should do some trick to prevent compile project(":library") being wrote into pom. It should transform to jcenter artifact path.
Maybe checkout Firebase-UI project.
It's possible that using https://github.com/bintray/gradle-bintray-plugin instead of https://github.com/novoda/bintray-release resolves this problem. It looks like https://github.com/novoda/bintray-release/issues/16 is tracking supporting this case for bintray-release.
I've manually fixed the POM file for now, so the following should work:
compile 'com.google.android.exoplayer:extension-okhttp:r2.0.1'
Note that if you tried whilst it was broken, you may have to do some cache wiping on your machine. File->InvalidateCaches in Android Studio wasn't sufficient for me. Neither was deleting the .gradle directory in the project. I had to also delete the .gradle directory from my home directory (disclaimer: I don't know what the consequences are of doing that; so do it at your own risk; I just know that it helped for me!).
I tried compile 'com.google.android.exoplayer:extension-okhttp:r1.5.14' because I'm relying on library which still uses ExoPlayer v1, but I found there is no such version of extension.
Is there any plans to release it for v1?
The OkHttp extension can be built from source for V1, but we will not be distributing it via Bintray/JCenter. We do distribute it for V2.
Most helpful comment
This enhancement is tracking: