chore(android): fix various warning (#3625)

This commit is contained in:
Olivier Bouillet 2024-03-31 20:03:52 +02:00 committed by GitHub
parent e87c14a437
commit d3cc0d0c5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@ import android.net.Uri;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import androidx.annotation.NonNull;
import androidx.media3.common.util.Util; import androidx.media3.common.util.Util;
import androidx.media3.datasource.RawResourceDataSource; import androidx.media3.datasource.RawResourceDataSource;
import androidx.media3.exoplayer.DefaultLoadControl; import androidx.media3.exoplayer.DefaultLoadControl;
@ -15,7 +16,6 @@ import com.brentvatne.common.api.SubtitleStyle;
import com.brentvatne.common.react.VideoEventEmitter; import com.brentvatne.common.react.VideoEventEmitter;
import com.brentvatne.common.toolbox.DebugLog; import com.brentvatne.common.toolbox.DebugLog;
import com.brentvatne.common.toolbox.ReactBridgeUtils; import com.brentvatne.common.toolbox.ReactBridgeUtils;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.MapBuilder; import com.facebook.react.common.MapBuilder;
@ -91,19 +91,21 @@ public class ReactExoplayerViewManager extends ViewGroupManager<ReactExoplayerVi
private static final String PROP_SHUTTER_COLOR = "shutterColor"; private static final String PROP_SHUTTER_COLOR = "shutterColor";
private static final String PROP_DEBUG = "debug"; private static final String PROP_DEBUG = "debug";
private ReactExoplayerConfig config; private final ReactExoplayerConfig config;
public ReactExoplayerViewManager(ReactExoplayerConfig config) { public ReactExoplayerViewManager(ReactExoplayerConfig config) {
this.config = config; this.config = config;
} }
@NonNull
@Override @Override
public String getName() { public String getName() {
return REACT_CLASS; return REACT_CLASS;
} }
@NonNull
@Override @Override
protected ReactExoplayerView createViewInstance(ThemedReactContext themedReactContext) { protected ReactExoplayerView createViewInstance(@NonNull ThemedReactContext themedReactContext) {
return new ReactExoplayerView(themedReactContext, config); return new ReactExoplayerView(themedReactContext, config);
} }
@ -197,9 +199,7 @@ public class ReactExoplayerViewManager extends ViewGroupManager<ReactExoplayerVi
} }
if (identifier > 0) { if (identifier > 0) {
Uri srcUri = RawResourceDataSource.buildRawResourceUri(identifier); Uri srcUri = RawResourceDataSource.buildRawResourceUri(identifier);
if (srcUri != null) {
videoView.setRawSrc(srcUri, extension); videoView.setRawSrc(srcUri, extension);
}
} else { } else {
videoView.clearSrc(); videoView.clearSrc();
} }