Features: - VOD library with movie grouping and version detection - TV show library with season/episode organization - TMDB integration for trending shows and recently aired episodes - Recent releases section with TMDB release date sorting - Watch history tracking with continue watching - Playlist caching (12-hour TTL) for offline support - M3U playlist parsing with XStream API support - Authentication with credential storage Technical: - SwiftUI for tvOS - Actor-based services for thread safety - Persistent caching for playlists, TMDB data, and watch history - KSPlayer integration for video playback Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
70 lines
1.7 KiB
Swift
70 lines
1.7 KiB
Swift
//
|
|
// PlayerFullScreenViewController.swift
|
|
// KSPlayer
|
|
//
|
|
// Created by kintan on 2021/8/20.
|
|
//
|
|
#if canImport(UIKit) && !os(tvOS)
|
|
|
|
import UIKit
|
|
|
|
protocol PlayerViewFullScreenDelegate: AnyObject {
|
|
func player(isMaskShow: Bool, isFullScreen: Bool)
|
|
}
|
|
|
|
class PlayerFullScreenViewController: UIViewController {
|
|
private let isHorizonal: Bool
|
|
private var statusHiden = false
|
|
init(isHorizonal: Bool) {
|
|
self.isHorizonal = isHorizonal
|
|
super.init(nibName: nil, bundle: nil)
|
|
}
|
|
|
|
@available(*, unavailable)
|
|
required init?(coder _: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
KSOptions.supportedInterfaceOrientations = isHorizonal ? .landscapeRight : .portrait
|
|
}
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
super.viewWillAppear(animated)
|
|
navigationController?.navigationBar.isHidden = true
|
|
UIApplication.shared.isIdleTimerDisabled = true
|
|
}
|
|
|
|
override var shouldAutorotate: Bool {
|
|
KSOptions.supportedInterfaceOrientations == .all
|
|
}
|
|
|
|
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
|
.all
|
|
}
|
|
|
|
override var prefersHomeIndicatorAutoHidden: Bool {
|
|
true
|
|
}
|
|
|
|
override var preferredStatusBarStyle: UIStatusBarStyle {
|
|
.lightContent
|
|
}
|
|
|
|
override var prefersStatusBarHidden: Bool {
|
|
statusHiden
|
|
}
|
|
}
|
|
|
|
extension PlayerFullScreenViewController: PlayerViewFullScreenDelegate {
|
|
func player(isMaskShow: Bool, isFullScreen: Bool) {
|
|
if isFullScreen {
|
|
statusHiden = !isMaskShow
|
|
setNeedsFocusUpdate()
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|