You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you format you message correctly (wrap code in ```), add results of react-native info command and provide repository with reproduction of this issue?
React Native version:59.8
Steps To Reproduce
1.write native component step by step like react native documentation but return nothing (white screen)
VideoPlayerPackage.java
package com.videoPlayer;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.videoPlayer.VideoPlayerManager;
import java.util.Collections;
import java.util.List;
public class VideoPlayerPackage implements ReactPackage {
@OverRide
public List createNativeModules(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
@OverRide
public List createViewManagers(ReactApplicationContext reactContext) {
return Collections.singletonList(new VideoPlayerManager());
}
}
VideoPlayerManager.java
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.view.View;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
public class VideoPlayerManager extends SimpleViewManager {
private static final String VIDEO_SOURCE = "src";
private static final String PROP_URI = "uri";
@OverRide
public String getName() {
return "VideoPlayer";
}
@OverRide
public VideoPlayerView createViewInstance(ThemedReactContext themedReactContext) {
return new VideoPlayerView(themedReactContext);
}
@ReactProp(name = VIDEO_SOURCE)
public void setSource(final View videoTest, @nullable ReadableMap src) {
}
}
VideoPlayerView.java
import android.content.Context;
import android.net.Uri;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.facebook.react.uimanager.ThemedReactContext;
import com.novincinema.cinemamarket.R;
public class VideoPlayerView extends RelativeLayout {
public VideoPlayerView(Context context) {
super(context);
init();
}
public VideoPlayerView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public VideoPlayerView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init() {
inflate(getContext(), R.layout.video_test, this);
}
}
The text was updated successfully, but these errors were encountered: