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 @implementation MediaDetailViewController
- (void)dealloc
{
[self stopVideo];
}
- (instancetype)initWithGalleryItemBox:(GalleryItemBox *)galleryItemBox - (instancetype)initWithGalleryItemBox:(GalleryItemBox *)galleryItemBox
viewItem:(ConversationViewItem *_Nullable)viewItem viewItem:(ConversationViewItem *_Nullable)viewItem
{ {

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

Loading…
Cancel
Save