Skip to content

Commit

Permalink
remove jcenter
Browse files Browse the repository at this point in the history
I removed jcenter() and added mavenCentral(), however it breaks exoplayer as ViroCore uses exoplayer 2.7.1 and the minimum version available in mavenCentral is 2.13.3 so some changes were required.
  • Loading branch information
doranteseduardo committed Sep 4, 2021
1 parent 5b6e56b commit 6bad81c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 39 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
compileSdkVersion 30

defaultConfig {
minSdkVersion 21
minSdkVersion 24
targetSdkVersion 30
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -41,7 +41,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:1.2.0"
implementation 'com.google.android.exoplayer:exoplayer:2.7.1'
implementation 'com.google.android.exoplayer:exoplayer:2.13.3'
implementation project(':libs:gvr')
implementation project(':libs:arcore')
implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
Expand Down
36 changes: 5 additions & 31 deletions android/app/src/main/java/com/viro/core/internal/AVPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,34 +95,10 @@ public AVPlayer(long nativeReference, Context context) {
mState = State.IDLE;
mMute = false;

TrackSelection.Factory trackSelectionFactory = new AdaptiveTrackSelection.Factory(new DefaultBandwidthMeter());
AdaptiveTrackSelection.Factory trackSelectionFactory = new AdaptiveTrackSelection.Factory();
DefaultTrackSelector trackSelector = new DefaultTrackSelector(trackSelectionFactory);
mExoPlayer = ExoPlayerFactory.newSimpleInstance(context, trackSelector);

mExoPlayer.addAudioDebugListener(new AudioRendererEventListener() {
@Override
public void onAudioEnabled(DecoderCounters counters) {
}
@Override
public void onAudioSessionId(int audioSessionId) {
}
@Override
public void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) {
Log.i(TAG, "AVPlayer audio decoder initialized " + decoderName);
}
@Override
public void onAudioInputFormatChanged(Format format) {
Log.i(TAG, "AVPlayer audio input format changed to " + format);
}

@Override
public void onAudioSinkUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs) {
}

@Override
public void onAudioDisabled(DecoderCounters counters) {
}
});
mExoPlayer.addListener(new Player.EventListener() {

@Override
Expand Down Expand Up @@ -226,7 +202,7 @@ public boolean setDataSourceURL(String resourceOrURL, final Context context) {
dataSourceFactory = new DataSource.Factory() {
@Override
public DataSource createDataSource() {
return new RawResourceDataSource(context, null);
return new RawResourceDataSource(context);
}
};
} else {
Expand Down Expand Up @@ -258,13 +234,11 @@ private MediaSource buildMediaSource(Uri uri, DataSource.Factory mediaDataSource
int type = inferContentType(uri);
switch (type) {
case C.TYPE_SS:
return new SsMediaSource(uri, mediaDataSourceFactory,
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), null, null);
return new SsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
case C.TYPE_DASH:
return new DashMediaSource(uri, mediaDataSourceFactory,
new DefaultDashChunkSource.Factory(mediaDataSourceFactory), null, null);
return new DashMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
case C.TYPE_HLS:
return new HlsMediaSource(uri, mediaDataSourceFactory, null, null);
return new HlsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
default:
// Return an ExtraMediaSource as default.
return new ExtractorMediaSource(uri, mediaDataSourceFactory, extractorsFactory,
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
Expand All @@ -13,7 +13,7 @@ allprojects {
group = 'com.viroCommunity'
version = getTagVersion()
repositories {
jcenter()
mavenCentral()
google()
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/nativetest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {

defaultConfig {
applicationId "com.viro.nativetest"
minSdkVersion 21
minSdkVersion 24
targetSdkVersion 30
versionCode 1
versionName "1.0"
Expand Down
2 changes: 1 addition & 1 deletion android/renderertest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {

defaultConfig {
applicationId "com.viromedia.renderertest"
minSdkVersion 21
minSdkVersion 24
targetSdkVersion 30
versionCode 1
versionName "1.0"
Expand Down
2 changes: 1 addition & 1 deletion android/virocore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:1.2.0"
implementation 'com.google.android.exoplayer:exoplayer:2.7.1'
implementation 'com.google.android.exoplayer:exoplayer:2.13.3'
implementation project(':libs:gvr')
implementation project(':libs:arcore')
implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
Expand Down
2 changes: 1 addition & 1 deletion android/viroreact/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:1.2.0"
implementation 'com.google.android.exoplayer:exoplayer:2.7.1'
implementation 'com.google.android.exoplayer:exoplayer:2.13.3'
implementation project(':libs:gvr')
implementation project(':libs:arcore')
implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
Expand Down

0 comments on commit 6bad81c

Please sign in to comment.