2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00
mastodon-ios/Mastodon/Protocol/NeedsDependency+AVPlayerViewControllerDelegate.swift
2021-03-10 15:06:24 +08:00

22 lines
869 B
Swift

//
// NeedsDependency+AVPlayerViewControllerDelegate.swift
// Mastodon
//
// Created by xiaojian sun on 2021/3/10.
//
import Foundation
import AVKit
extension NeedsDependency where Self: AVPlayerViewControllerDelegate {
func handlePlayerViewController(_ playerViewController: AVPlayerViewController, willBeginFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator) {
context.videoPlaybackService.playerViewModel(for: playerViewController)?.isFullScreenPresentationing = true
}
func handlePlayerViewController(_ playerViewController: AVPlayerViewController, willEndFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator) {
context.videoPlaybackService.playerViewModel(for: playerViewController)?.isFullScreenPresentationing = false
}
}