Skip to content

Commit

Permalink
🚢 Release 2.32.0 (#3180)
Browse files Browse the repository at this point in the history
  • Loading branch information
gewfy authored Aug 19, 2023
2 parents 39b2cea + c36c95e commit d38423a
Show file tree
Hide file tree
Showing 16 changed files with 332 additions and 217 deletions.
6 changes: 6 additions & 0 deletions client/__mocks__/react-native-volume-manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const mockVolumeManager = {
getVolume: jest.fn(),
setVolume: jest.fn(),
};

export const VolumeManager = mockVolumeManager;
8 changes: 4 additions & 4 deletions client/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ android {
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 131
versionName "2.31.0"
versionCode 132
versionName "2.32.0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

// Solving the issue with binary resource modify time with code push
Expand Down Expand Up @@ -306,10 +306,10 @@ dependencies {

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

implementation('com.google.android.exoplayer:exoplayer:2.18.7') {
implementation('androidx.media3:media3-exoplayer:1.1.0') {
exclude group: 'com.android.support'
}
implementation('com.google.android.exoplayer:extension-okhttp:2.18.7') {
implementation('androidx.media3:media3-datasource-okhttp:1.1.0') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.twentyninek.app.cupcake.newarchitecture.videoLooper;

import com.google.android.exoplayer2.MediaItem;
import androidx.media3.common.MediaItem;

public class MediaItemConfig {
private String _source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.events.RCTEventEmitter;
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.source.DefaultMediaSourceFactory;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.video.VideoSize;

import androidx.annotation.OptIn;
import androidx.media3.common.MediaItem;
import androidx.media3.common.PlaybackException;
import androidx.media3.common.Player;
import androidx.media3.common.VideoSize;
import androidx.media3.common.util.UnstableApi;
import androidx.media3.exoplayer.ExoPlayer;
import androidx.media3.exoplayer.source.DefaultMediaSourceFactory;
import androidx.media3.exoplayer.source.MediaSource;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -177,6 +180,7 @@ private void sendEvent(ThemedReactContext reactContext,
.receiveEvent(getId(), eventName, properties);
}

@OptIn(markerClass = UnstableApi.class)
private void initializeMediaPlayer(boolean isLocal) {
if (_player == null) {
if (isLocal) {
Expand All @@ -202,9 +206,11 @@ private boolean isLocalAsset(String src) {
}
return true;
}

public void setSources(ReadableArray sources) {
new Handler().postDelayed(new Runnable() {
@Override
@OptIn(markerClass = UnstableApi.class)
public void run() {
List<MediaSource> mediaSources = new ArrayList<>();
List<MediaItem> mediaItems = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
import android.net.Uri;

import com.facebook.react.uimanager.ThemedReactContext;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.database.StandaloneDatabaseProvider;
import com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DataSpec;
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
import com.google.android.exoplayer2.upstream.cache.CacheWriter;
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
import com.google.android.exoplayer2.upstream.cache.SimpleCache;

import androidx.annotation.OptIn;
import androidx.media3.common.MediaItem;
import androidx.media3.common.util.UnstableApi;
import androidx.media3.database.StandaloneDatabaseProvider;
import androidx.media3.datasource.DataSource;
import androidx.media3.datasource.DataSpec;
import androidx.media3.datasource.cache.CacheDataSource;
import androidx.media3.datasource.cache.CacheWriter;
import androidx.media3.datasource.cache.LeastRecentlyUsedCacheEvictor;
import androidx.media3.datasource.cache.SimpleCache;
import androidx.media3.datasource.okhttp.OkHttpDataSource;
import androidx.media3.exoplayer.source.MediaSource;
import androidx.media3.exoplayer.source.ProgressiveMediaSource;
import androidx.media3.exoplayer.upstream.DefaultLoadErrorHandlingPolicy;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -46,6 +49,7 @@ public CacheDataSource.Factory getCachedDataSourceFactory() {
return _cachedDataSourceFactory;
}

@OptIn(markerClass = UnstableApi.class)
public void prepare(ThemedReactContext context) {
if (!_prepared) {
String cacheDir = context.getExternalCacheDir() + "/ExoVideoCache";
Expand All @@ -62,6 +66,7 @@ public void prepare(ThemedReactContext context) {
}
}

@OptIn(markerClass = UnstableApi.class)
public void preCache(String url) {
executorService.execute(() -> {
DataSpec dataSpec = new DataSpec.Builder()
Expand All @@ -78,6 +83,7 @@ public void preCache(String url) {
});
}

@OptIn(markerClass = UnstableApi.class)
public MediaSource getCachedMediaSource(MediaItem mediaItem) {
MediaSource mediaSource =
new ProgressiveMediaSource.Factory(_cachedDataSourceFactory)
Expand Down
Loading

0 comments on commit d38423a

Please sign in to comment.