parent
f037101af6
commit
428802aee8
|
@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
- (void)playVideo;
|
||||
|
||||
// Stops playback and rewinds
|
||||
- (void)stopVideo;
|
||||
- (void)stopAnyVideo;
|
||||
|
||||
- (void)setShouldHideToolbars:(BOOL)shouldHideToolbars;
|
||||
- (void)zoomOutAnimated:(BOOL)isAnimated;
|
||||
|
|
|
@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self stopVideo];
|
||||
[self stopAnyVideo];
|
||||
}
|
||||
|
||||
- (instancetype)initWithGalleryItemBox:(GalleryItemBox *)galleryItemBox
|
||||
|
@ -576,6 +576,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[self.delegate mediaDetailViewController:self isPlayingVideo:NO];
|
||||
}
|
||||
|
||||
- (void)stopAnyVideo
|
||||
{
|
||||
if (self.isVideo) {
|
||||
[self stopVideo];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)stopVideo
|
||||
{
|
||||
OWSAssert(self.isVideo);
|
||||
|
|
|
@ -190,7 +190,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
|
|||
public func didPressAllMediaButton(sender: Any) {
|
||||
Logger.debug("\(logTag) in \(#function)")
|
||||
|
||||
currentViewController.stopVideo()
|
||||
currentViewController.stopAnyVideo()
|
||||
|
||||
guard let mediaGalleryDataSource = self.mediaGalleryDataSource else {
|
||||
owsFail("\(logTag) in \(#function) mediaGalleryDataSource was unexpectedly nil")
|
||||
|
@ -335,10 +335,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
|
|||
// Do any cleanup for the no-longer visible view controller
|
||||
if transitionCompleted {
|
||||
previousPage.zoomOut(animated: false)
|
||||
|
||||
if previousPage.galleryItem.isVideo {
|
||||
previousPage.stopVideo()
|
||||
}
|
||||
previousPage.stopAnyVideo()
|
||||
updateFooterBarButtonItems(isPlayingVideo: false)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue