Skip to content
Open
Show file tree
Hide file tree
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 @@ -427,12 +427,9 @@ public void onPause() {
pause();
}

@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
protected void cleanup() {
release();
handler.removeCallbacks(timeDetector);
TransparentVideoViewManager.destroyView((LinearLayout)this.getParent());
handler.removeCallbacks(timeDetector);
}

private void prepareAsync(final MediaPlayer.OnPreparedListener onPreparedListener) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

public class TransparentVideoViewManager extends SimpleViewManager<LinearLayout> {

private static List<LinearLayout> sInstances = new ArrayList<>();

public static final String REACT_CLASS = "TransparentVideoView";
private static final String TAG = "TransparentVideoViewManager";

Expand All @@ -43,12 +41,14 @@ public String getName() {
@NonNull
public LinearLayout createViewInstance(ThemedReactContext reactContext) {
LinearLayout view = new LinearLayout(this.reactContext);
sInstances.add(view);
return view;
}

public static void destroyView(LinearLayout view) {
sInstances.remove(view);
@Override
public void onDropViewInstance(@NonNull LinearLayout view) {
super.onDropViewInstance(view);
AlphaMovieView alphaMovieView = (AlphaMovieView)view.getChildAt(0);
alphaMovieView.cleanup();
}

@ReactProp(name = "src")
Expand Down