Skip to content

Commit

Permalink
fix. parent = null
Browse files Browse the repository at this point in the history
  • Loading branch information
iielse committed Sep 7, 2022
1 parent 4e3716b commit 61ea304
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ class FullVideoActivity : AppCompatActivity() {
if (released) return
val view = videoView ?: return
(view.parent as ViewGroup?)?.removeView(view)
videoParentRef?.get()?.addView(view)
view.setAutoRelease(true)

val parent = videoParentRef?.get()
if (parent != null) {
parent.addView(view)
view.setAutoRelease(true)
} else view.release()

videoParentRef = null
videoView = null
released = true
Expand Down

0 comments on commit 61ea304

Please sign in to comment.