From bca54b67ce109c1583a0076bb26e3953e17740d3 Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Wed, 24 Jan 2024 13:29:11 -0500 Subject: [PATCH 1/9] Upgrade gradle 7.3.3 --> 7.5 --- android/gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 2e6e5897b..2ec77e51a 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 2d120e3cbc218db4637d610a1988f32594da59bb Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Wed, 24 Jan 2024 14:42:28 -0500 Subject: [PATCH 2/9] gradlew check finishes successfully --- android/memoryleaktest/build.gradle | 4 +-- .../src/main/AndroidManifest.xml | 4 +++ android/nativetest/build.gradle | 4 +-- .../nativetest/src/main/AndroidManifest.xml | 6 +++- android/releasetest/build.gradle | 4 +-- .../releasetest/src/main/AndroidManifest.xml | 6 +++- android/renderertest/build.gradle | 4 +-- .../renderertest/src/main/AndroidManifest.xml | 6 +++- .../sharedCode/src/main/AndroidManifest.xml | 2 +- .../java/com/viro/core/internal/AVPlayer.java | 36 +++++++++---------- 10 files changed, 46 insertions(+), 30 deletions(-) diff --git a/android/memoryleaktest/build.gradle b/android/memoryleaktest/build.gradle index 126035eca..1bbbcb653 100644 --- a/android/memoryleaktest/build.gradle +++ b/android/memoryleaktest/build.gradle @@ -4,11 +4,11 @@ apply plugin: 'kotlin-android' android { flavorDimensions "target_platform" - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { applicationId "com.example.memoryleaktest" minSdkVersion 24 - targetSdkVersion 31 + targetSdkVersion 33 versionCode 1 versionName "1.0" diff --git a/android/memoryleaktest/src/main/AndroidManifest.xml b/android/memoryleaktest/src/main/AndroidManifest.xml index 25fadd8dd..34706ea50 100644 --- a/android/memoryleaktest/src/main/AndroidManifest.xml +++ b/android/memoryleaktest/src/main/AndroidManifest.xml @@ -1,7 +1,11 @@ + + diff --git a/android/nativetest/build.gradle b/android/nativetest/build.gradle index f5f75d69d..5d53d33bf 100644 --- a/android/nativetest/build.gradle +++ b/android/nativetest/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.application' android { flavorDimensions "target_platform" - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { applicationId "com.viro.nativetest" minSdkVersion 24 - targetSdkVersion 31 + targetSdkVersion 33 versionCode 1 versionName "1.0" missingDimensionStrategy 'product', 'viro_core' diff --git a/android/nativetest/src/main/AndroidManifest.xml b/android/nativetest/src/main/AndroidManifest.xml index ed25db0cc..2efff60f2 100644 --- a/android/nativetest/src/main/AndroidManifest.xml +++ b/android/nativetest/src/main/AndroidManifest.xml @@ -2,13 +2,17 @@ + + - + diff --git a/android/releasetest/build.gradle b/android/releasetest/build.gradle index 8633d306b..5d371a07b 100644 --- a/android/releasetest/build.gradle +++ b/android/releasetest/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'kotlin-android' android { flavorDimensions "target_platform" - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { applicationId "com.viromedia.releasetest" minSdkVersion 24 - targetSdkVersion 31 + targetSdkVersion 33 versionCode 1 versionName "1.0" diff --git a/android/releasetest/src/main/AndroidManifest.xml b/android/releasetest/src/main/AndroidManifest.xml index 6333e8316..e43584aa9 100644 --- a/android/releasetest/src/main/AndroidManifest.xml +++ b/android/releasetest/src/main/AndroidManifest.xml @@ -2,13 +2,17 @@ + + - + diff --git a/android/renderertest/build.gradle b/android/renderertest/build.gradle index 4bcb14f71..3139e9dfa 100644 --- a/android/renderertest/build.gradle +++ b/android/renderertest/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.application' android { flavorDimensions "target_platform" - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { applicationId "com.viromedia.renderertest" minSdkVersion 24 - targetSdkVersion 31 + targetSdkVersion 33 versionCode 1 versionName "1.0" missingDimensionStrategy 'product', 'viro_core' diff --git a/android/renderertest/src/main/AndroidManifest.xml b/android/renderertest/src/main/AndroidManifest.xml index 5c0cf87f7..50f7dc69d 100644 --- a/android/renderertest/src/main/AndroidManifest.xml +++ b/android/renderertest/src/main/AndroidManifest.xml @@ -2,7 +2,11 @@ + + @@ -10,7 +14,7 @@ - + diff --git a/android/sharedCode/src/main/AndroidManifest.xml b/android/sharedCode/src/main/AndroidManifest.xml index 0046df181..b1dfff4cb 100644 --- a/android/sharedCode/src/main/AndroidManifest.xml +++ b/android/sharedCode/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ - + diff --git a/android/sharedCode/src/main/java/com/viro/core/internal/AVPlayer.java b/android/sharedCode/src/main/java/com/viro/core/internal/AVPlayer.java index e812bc727..1b2a60eff 100644 --- a/android/sharedCode/src/main/java/com/viro/core/internal/AVPlayer.java +++ b/android/sharedCode/src/main/java/com/viro/core/internal/AVPlayer.java @@ -33,6 +33,7 @@ import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.DefaultLoadControl; import com.google.android.exoplayer2.ExoPlayer; +import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.PlaybackException; import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.SimpleExoPlayer; @@ -71,7 +72,7 @@ private enum State { STARTED, } - private final SimpleExoPlayer mExoPlayer; + private final ExoPlayer mExoPlayer; private float mVolume; private final long mNativeReference; private boolean mLoop; @@ -88,13 +89,12 @@ public AVPlayer(long nativeReference, Context context) { mMute = false; AdaptiveTrackSelection.Factory trackSelectionFactory = new AdaptiveTrackSelection.Factory(); - DefaultTrackSelector trackSelector = new DefaultTrackSelector(trackSelectionFactory); - mExoPlayer = new SimpleExoPlayer.Builder(context).setTrackSelector(trackSelector).setLoadControl(new DefaultLoadControl()).build(); - - mExoPlayer.addListener(new Player.EventListener() { + DefaultTrackSelector trackSelector = new DefaultTrackSelector(context, trackSelectionFactory); + mExoPlayer = new ExoPlayer.Builder(context).setTrackSelector(trackSelector).setLoadControl(new DefaultLoadControl()).build(); + mExoPlayer.addListener(new Player.Listener() { @Override - public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { + public void onPlaybackStateChanged(@Player.State int playbackState) { // this function sometimes gets called back w/ the same playbackState. if (mPrevExoPlayerState == playbackState) { return; @@ -175,34 +175,34 @@ public DataSource createDataSource() { private MediaSource buildMediaSource(Uri uri, DataSource.Factory mediaDataSourceFactory, ExtractorsFactory extractorsFactory) { int type = inferContentType(uri); switch (type) { - case C.TYPE_SS: - return new SsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri); - case C.TYPE_DASH: - return new DashMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri); - case C.TYPE_HLS: - return new HlsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri); + case C.CONTENT_TYPE_SS: + return new SsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(MediaItem.fromUri(uri)); + case C.CONTENT_TYPE_DASH: + return new DashMediaSource.Factory(mediaDataSourceFactory).createMediaSource(MediaItem.fromUri(uri)); + case C.CONTENT_TYPE_HLS: + return new HlsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(MediaItem.fromUri(uri)); default: // Return an ExtraMediaSource as default. - return new ProgressiveMediaSource.Factory(mediaDataSourceFactory, extractorsFactory).createMediaSource(uri); + return new ProgressiveMediaSource.Factory(mediaDataSourceFactory, extractorsFactory).createMediaSource(MediaItem.fromUri(uri)); } } private int inferContentType(Uri uri) { String path = uri.getPath(); - return path == null ? C.TYPE_OTHER : inferContentType(path); + return path == null ? C.CONTENT_TYPE_OTHER : inferContentType(path); } private int inferContentType(String fileName) { fileName = Ascii.toLowerCase(fileName); if (fileName.endsWith(".mpd")) { - return C.TYPE_DASH; + return C.CONTENT_TYPE_DASH; } else if (fileName.endsWith(".m3u8")) { - return C.TYPE_HLS; + return C.CONTENT_TYPE_HLS; } else if (fileName.endsWith(".ism") || fileName.endsWith(".isml") || fileName.endsWith(".ism/manifest") || fileName.endsWith(".isml/manifest")) { - return C.TYPE_SS; + return C.CONTENT_TYPE_SS; } else { - return C.TYPE_OTHER; + return C.CONTENT_TYPE_OTHER; } } From ec10beb6fc5dcfccdf0bb1fd5cbba27c654b9b75 Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Wed, 24 Jan 2024 14:50:13 -0500 Subject: [PATCH 3/9] Update names of GitHub actions to be clearer --- .github/workflows/pull-request.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ab848d98c..f98d64e31 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,4 +1,4 @@ -name: Renderer +name: Build ViroCore Renderer on: push: @@ -8,13 +8,14 @@ on: jobs: androidBuild: + name: Android Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.3.0 - name: set up JDK uses: actions/setup-java@v3 with: - distribution: 'adopt' + distribution: "adopt" java-version: 11 - name: assemble ViroCore @@ -30,8 +31,8 @@ jobs: ./android/viroreact/build/outputs/aar/*.aar ./android/viroar/build/outputs/aar/*.aar - AndroidCheck: - name: Check + androidCheck: + name: Android Lint Check runs-on: ubuntu-latest defaults: run: @@ -57,13 +58,14 @@ jobs: ./**/build/reports/lint-results.html ./**/**/build/reports/lint-results.html - iosBuild: + iOSBuild: + name: iOS Build runs-on: ${{ matrix.macOS }} strategy: fail-fast: false matrix: - xcode: [ '12.5.1', '13.2.1' ] - macOS: [ 'macOS-11' ] + xcode: ["12.5.1", "13.2.1"] + macOS: ["macOS-11"] steps: - uses: actions/checkout@v3.3.0 - name: Install gpg From 60fdfff669448e6d87ed60d7e2759b2a2e36a06c Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Wed, 24 Jan 2024 14:57:58 -0500 Subject: [PATCH 4/9] Update matrix of xCode versions to be most recent two - xCode 14.3.1 - xCode 15.2 https://xcodereleases.com/ --- .github/workflows/pull-request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f98d64e31..9625a4b4c 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -64,8 +64,8 @@ jobs: strategy: fail-fast: false matrix: - xcode: ["12.5.1", "13.2.1"] - macOS: ["macOS-11"] + xcode: ["14.3.1", "15.2"] + macOS: ["macOS-14"] steps: - uses: actions/checkout@v3.3.0 - name: Install gpg @@ -86,7 +86,7 @@ jobs: -scheme ViroKit \ -sdk iphoneos \ -configuration Release \ - IPHONEOS_DEPLOYMENT_TARGET=9.0 + IPHONEOS_DEPLOYMENT_TARGET=13.0 - name: Upload iOS Renderer artifact uses: actions/upload-artifact@v3.1.2 From 901094f0c3f1526731737aa6458fec784bdf7769 Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Wed, 24 Jan 2024 15:05:01 -0500 Subject: [PATCH 5/9] Use latest MacOS image --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9625a4b4c..6803c6d50 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -65,7 +65,7 @@ jobs: fail-fast: false matrix: xcode: ["14.3.1", "15.2"] - macOS: ["macOS-14"] + macOS: ["latest"] steps: - uses: actions/checkout@v3.3.0 - name: Install gpg From b4e016c394afce897ff8ca358d9e3f7867bb9154 Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Wed, 24 Jan 2024 15:06:07 -0500 Subject: [PATCH 6/9] Fix MacOS label --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6803c6d50..24380b450 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -65,7 +65,7 @@ jobs: fail-fast: false matrix: xcode: ["14.3.1", "15.2"] - macOS: ["latest"] + macOS: ["macos-latest"] steps: - uses: actions/checkout@v3.3.0 - name: Install gpg From 55dde25489b8e16eef87bbc8f1c579b532233811 Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Wed, 24 Jan 2024 15:16:35 -0500 Subject: [PATCH 7/9] Use the right versions of MacOS --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 24380b450..0a0d8ec22 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -64,7 +64,7 @@ jobs: strategy: fail-fast: false matrix: - xcode: ["14.3.1", "15.2"] + xcode: ["14.2.0", "13.4.1"] macOS: ["macos-latest"] steps: - uses: actions/checkout@v3.3.0 From 3035a06d75da9cf7545dab1147eaa22919b074b0 Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Sun, 28 Jan 2024 14:08:03 -0500 Subject: [PATCH 8/9] Fix GitHub actions issues - macos-latest --> macos-12 - Add xcpretty --- .github/workflows/pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0a0d8ec22..aec93ed12 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -65,7 +65,7 @@ jobs: fail-fast: false matrix: xcode: ["14.2.0", "13.4.1"] - macOS: ["macos-latest"] + macOS: ["macos-12"] steps: - uses: actions/checkout@v3.3.0 - name: Install gpg @@ -86,7 +86,7 @@ jobs: -scheme ViroKit \ -sdk iphoneos \ -configuration Release \ - IPHONEOS_DEPLOYMENT_TARGET=13.0 + IPHONEOS_DEPLOYMENT_TARGET=13.0 | xcpretty - name: Upload iOS Renderer artifact uses: actions/upload-artifact@v3.1.2 From 3acbf9210ed2615d843b02aadc9271296f6e4d25 Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Sun, 28 Jan 2024 14:16:36 -0500 Subject: [PATCH 9/9] Fix xcpretty usage for false positive success - https://github.com/xcpretty/xcpretty?tab=readme-ov-file#usage --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index aec93ed12..c43539746 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -81,7 +81,7 @@ jobs: - name: Xcodebuild iOS Renderer (non-static) run: | cd ios - xcodebuild \ + set -o pipefail && xcodebuild \ -workspace ViroRenderer.xcworkspace \ -scheme ViroKit \ -sdk iphoneos \