Stop any video whenever leaving PageView

// FREEBIE
pull/1/head
Michael Kirk 7 years ago
parent 5ec3df93fa
commit 24eb4bf443

@ -79,6 +79,11 @@ NS_ASSUME_NONNULL_BEGIN
@implementation MediaDetailViewController
- (void)dealloc
{
[self stopVideo];
}
- (instancetype)initWithGalleryItemBox:(GalleryItemBox *)galleryItemBox
viewItem:(ConversationViewItem *_Nullable)viewItem
{

@ -8,11 +8,11 @@ import UIKit
@objc
public class GalleryItemBox: NSObject {
public let value: MediaGalleryItem
init(_ value: MediaGalleryItem) {
self.value = value
}
public var attachmentStream: TSAttachmentStream {
return value.attachmentStream
}
@ -190,6 +190,8 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
public func didPressAllMediaButton(sender: Any) {
Logger.debug("\(logTag) in \(#function)")
currentViewController.stopVideo()
guard let mediaGalleryDataSource = self.mediaGalleryDataSource else {
owsFail("\(logTag) in \(#function) mediaGalleryDataSource was unexpectedly nil")
return

Loading…
Cancel
Save