Stop any video whenever leaving PageView
// FREEBIE
This commit is contained in:
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…
Reference in New Issue
Block a user