question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] Player sometimes keeps seeking after view is unmounted

See original GitHub issue

This happens on remote video URLs.

Reproduction:

  1. Create Video player with remote video URL (https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4)
  2. Make it play (at this point you’ll notice an activity indicator show up at the top left in your status bar, which indicates that it is buffering the video)
  3. Unmount the Video player by either navigating away or change a state variable that causes the player to not show
  4. The activity indicator at the top left in the status bar will keep spinning (it should disappear)

I think this happens when the network request hasn’t finished responding and therefore the AVPlayerItem is stuck in seeking mode. I think that in the removeFromSuperview lifecycle, we need to call cancelPendingSeeks on the AVPlayerItem.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kshahkshahcommented, Sep 21, 2017

Yes, but is this going to blow up memory by pausing w/o unmounting. This seems like a serious issue if so.

1reaction
pribehcommented, Apr 24, 2019

Experiencing the same here. I’m not quite sure yet what isn’t unmounting but there is a memory leak for sure after a video is played.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Camera is still active after unmounting · Issue #905 - GitHub
We noticed that the Camera is still streaming frames even after the component is unmounted. This is made apparent by the green dot...
Read more >
React useEffect causing: Can't perform a React state update ...
If the component updates it's state after it has been unmounted from the DOM, this is an indication that there could be a...
Read more >
React: Stop checking if your component is mounted - Medium
This article will provide solutions to the “Can't perform a React state update on an unmounted component” warning and why a call to...
Read more >
Apple Style Guide
Writers, editors, and developers can use this document as a guide to writing style, usage, and Apple product terminology. Writers and editors should ......
Read more >
Avoid Memory Leak With React SetState On An Unmounted ...
Specifically, calling setState() in an unmounted component means that your app is still holding a reference to the component after the component ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found