mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Limit PiP for native videos
This commit is contained in:
parent
bf32735d2c
commit
d75257df43
@ -2064,6 +2064,18 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc func pictureInPictureButtonPressed() {
|
@objc func pictureInPictureButtonPressed() {
|
||||||
|
var isNativePictureInPictureSupported = false
|
||||||
|
switch self.item?.contentInfo {
|
||||||
|
case let .message(message):
|
||||||
|
for media in message.media {
|
||||||
|
if let media = media as? TelegramMediaFile, media.isVideo {
|
||||||
|
isNativePictureInPictureSupported = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
if let item = self.item, let videoNode = self.videoNode, let overlayController = self.context.sharedContext.mediaManager.overlayMediaManager.controller {
|
if let item = self.item, let videoNode = self.videoNode, let overlayController = self.context.sharedContext.mediaManager.overlayMediaManager.controller {
|
||||||
videoNode.setContinuePlayingWithoutSoundOnLostAudioSession(false)
|
videoNode.setContinuePlayingWithoutSoundOnLostAudioSession(false)
|
||||||
|
|
||||||
@ -2071,7 +2083,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
let baseNavigationController = self.baseNavigationController()
|
let baseNavigationController = self.baseNavigationController()
|
||||||
let playbackRate = self.playbackRate
|
let playbackRate = self.playbackRate
|
||||||
|
|
||||||
if #available(iOSApplicationExtension 15.0, iOS 15.0, *), AVPictureInPictureController.isPictureInPictureSupported() {
|
if #available(iOSApplicationExtension 15.0, iOS 15.0, *), AVPictureInPictureController.isPictureInPictureSupported(), isNativePictureInPictureSupported {
|
||||||
self.disablePictureInPicturePlaceholder = true
|
self.disablePictureInPicturePlaceholder = true
|
||||||
|
|
||||||
let overlayVideoNode = UniversalVideoNode(postbox: self.context.account.postbox, audioSession: self.context.sharedContext.mediaManager.audioSession, manager: self.context.sharedContext.mediaManager.universalVideoManager, decoration: GalleryVideoDecoration(), content: item.content, priority: .overlay)
|
let overlayVideoNode = UniversalVideoNode(postbox: self.context.account.postbox, audioSession: self.context.sharedContext.mediaManager.audioSession, manager: self.context.sharedContext.mediaManager.universalVideoManager, decoration: GalleryVideoDecoration(), content: item.content, priority: .overlay)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user