Video Players in Messages go black if you have more than 5-10 videos in the conversation.

Radar: 28099040

Radar includes a video and sample project that easily demonstrate the issue.


If you send multiple videos (ie. mp4) in a Messages conversation, they start showing up as black and not playing.


* The issue gets worse and worse. If you send 10 videos, a few of them will be black. If you send 20, most will be black.

* This demonstrates most readily if you use [MSConversation insertMessage:] and using the MSMessageTemplateLayout's mediaFileURL property to insert the video into the conversation, since Messages will auto-play the videos in this case.

* Presumably this is because of iOS's well-known but poorly-documented limit on how many AVPlayer instances can be active at a time. See these links:


http://stackoverflow.com/questions/10016407/avplayer-crashes-after-multiple-playbacks


https://iosguy.com/tag/avplayer/

Replies

Hi charlesmchen, have you solved this problem?

I can confirm this problem still exists in iOS 11 and I reported it also via the bugtracker to Apple a few months ago, (April 2018).


My test code is available at https://github.com/paulfreeman/iMessageAddingVideos


There are even more problems in iOS 12 b2, but that may be just the beta, in this beta errors are generated when I try to insert videos either as attachments or as media displayed in an MSMessageTemplateLayout from the test app.


With the test code on iOS 11 I verified that the problem lies not with videos, as attachments work without issue, but only with the video media included with MSMessageTemplateLayout. I can observe that the system memory (outside the app) in debug mode is not managed effectively with the MSMessageTemplateLayout instances (it seems to just grow), whereas included attachments are handled well, at least on iOS 11.