Skip to content
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

chore: clean up ReactExoplayerView class #4141

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import static androidx.media3.common.C.CONTENT_TYPE_SS;
import static androidx.media3.common.C.TIME_END_OF_SOURCE;


import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ActivityManager;
Expand All @@ -24,7 +23,6 @@
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import android.view.accessibility.CaptioningManager;
import android.widget.FrameLayout;
import android.widget.ImageButton;
Expand All @@ -34,9 +32,6 @@
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.NonNull;
import androidx.annotation.WorkerThread;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.core.view.WindowInsetsControllerCompat;
import androidx.media3.common.AudioAttributes;
import androidx.media3.common.C;
import androidx.media3.common.Format;
Expand Down Expand Up @@ -131,18 +126,17 @@
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.uimanager.ThemedReactContext;
import com.google.ads.interactivemedia.v3.api.AdError;
import com.google.ads.interactivemedia.v3.api.AdEvent;
import com.google.ads.interactivemedia.v3.api.AdErrorEvent;
import com.google.ads.interactivemedia.v3.api.ImaSdkSettings;
import com.google.ads.interactivemedia.v3.api.AdEvent;
import com.google.ads.interactivemedia.v3.api.ImaSdkFactory;
import com.google.ads.interactivemedia.v3.api.ImaSdkSettings;
import com.google.common.collect.ImmutableList;

import java.net.CookieHandler;
import java.net.CookieManager;
import java.net.CookiePolicy;
import java.lang.Math;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -191,8 +185,6 @@ public class ReactExoplayerView extends FrameLayout implements
private ExoPlayer player;
private DefaultTrackSelector trackSelector;
private boolean playerNeedsSource;
private MediaMetadata customMetadata;

private ServiceConnection playbackServiceConnection;
private PlaybackServiceBinder playbackServiceBinder;

Expand All @@ -205,7 +197,6 @@ public class ReactExoplayerView extends FrameLayout implements
private long resumePosition;
private boolean loadVideoStarted;
private boolean isFullscreen;
private boolean originalFitsSystemWindows;
private boolean isInBackground;
private boolean isPaused;
private boolean isBuffering;
Expand Down Expand Up @@ -271,7 +262,7 @@ public class ReactExoplayerView extends FrameLayout implements

private boolean viewHasDropped = false;

private String instanceId = String.valueOf(UUID.randomUUID());
private final String instanceId = String.valueOf(UUID.randomUUID());

private CmcdConfiguration.Factory cmcdConfigurationFactory;

Expand Down Expand Up @@ -1028,7 +1019,7 @@ private MediaSource buildMediaSource(Uri uri, String overrideExtension, DrmSessi
.setUri(uri);

// refresh custom Metadata
customMetadata = ConfigurationUtils.buildCustomMetadata(source.getMetadata());
MediaMetadata customMetadata = ConfigurationUtils.buildCustomMetadata(source.getMetadata());
if (customMetadata != null) {
mediaItemBuilder.setMediaMetadata(customMetadata);
}
Expand Down Expand Up @@ -2269,8 +2260,6 @@ public void setFullscreen(boolean fullscreen) {
return;
}

Window window = activity.getWindow();
WindowInsetsControllerCompat controller = new WindowInsetsControllerCompat(window, window.getDecorView());
if (isFullscreen) {
eventEmitter.onVideoFullscreenPlayerWillPresent.invoke();
if (fullScreenPlayerView != null) {
Expand Down
Loading