How to stop MPAVItem crashing my iOS application with video in my UIWebView?

I have a web presentation that is constantly refreshing and showing new videos and images. I suspect that the objects in the HTML page are not correctly freed because my memory is slowly growing. I also get a crash when calling a method on MPAVItem that has already been freed. I do not use MPAVItem directly, its object is created and used automatically using webview for my embedded videos. Specific emergency reset

Thread 0: 0 libobjc.A.dylib 0x3b17c636 objc_msgSend + 22 1 Foundation 0x30ef4aca +[NSConcreteNotification newTempNotificationWithName:object:userInfo:] + 118 2 Foundation 0x30ef4a20 -[NSNotificationCenter postNotificationName:object:userInfo:] + 48 3 Foundation 0x30ef9316 -[NSNotificationCenter postNotificationName:object:] + 26 4 MediaPlayer 0x3183ff04 __53-[MPAVItem _playerItemNewAccessLogEntryNotification:]_block_invoke + 68 

I need to leave the application almost an hour before it crashes. Updating a web page every 7 seconds will result in a crash or due to too many processes, from memory or access to MPAVItem. I tried everything I found on the network, for example, javascript tricks such as pausing a video, rewinding, setting the video src to ", clearing the entire document, setting webview to zero. Nothing completely removes these objects. To complicate the situation, I have there are images and videos in the iframe. The code in the main document is actually a β€œplayer” that controls the reloading of the iframe content. The IFrame changes the content every 7 seconds and the entire page (player) is updated every 20 seconds.

+6
source share
1 answer

Some time ago I had a problem with UIWebView. The video was not shown constantly (sometimes it was not done sometimes).

This is not exactly your problem, but keep reading.;) I found that restrictions are very important for web browsing. If you have not set limits, set them and double check them, if they are set, probably.

In my case, the video was repeated for playback in the view. This caused a memory leak in the program. Therefore, limitations can be a factor in memory leak.

Hope this helps!

+1
source

All Articles