Stop playing any video on disappearing of MXKAttachmentsViewController
MODIFY
MatrixKit/Controllers/MXKAttachmentsViewController.m
MatrixKit/Controllers/MXKAttachmentsViewController.m
}
- (void)viewWillDisappear:(BOOL)animated
-
-
{
if (tempFile)
{
currentAlert = nil;
}
+ // Stop playing any video
+ for (MXKMediaCollectionViewCell *cell in self.attachmentsCollection.visibleCells)
+ {
+ [cell.moviePlayer stop];
+ }
+
// Restore audio category
if (savedAVAudioSessionCategory)
{

MODIFY
MatrixKit/Views/MXKCollectionViewCell/MXKMediaCollectionViewCell.m
MatrixKit/Views/MXKCollectionViewCell/MXKMediaCollectionViewCell.m
return self;
}
+- (void)prepareForReuse
+{
+ [super prepareForReuse];
+ [self.moviePlayer stop];
+ self.moviePlayer = nil;
+}
+
+- (void)dealloc
+{
+ [self.moviePlayer stop];
+}
+
@end

Stop playing any video on disappearing of MXKAttachmentsViewController