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>
49 lines
892 B
Swift
49 lines
892 B
Swift
//
|
|
// File.swift
|
|
// KSPlayer
|
|
//
|
|
// Created by kintan on 2018/3/9.
|
|
//
|
|
#if canImport(UIKit)
|
|
import UIKit
|
|
#else
|
|
import AppKit
|
|
#endif
|
|
|
|
extension UIView {
|
|
var backingLayer: CALayer? {
|
|
#if !canImport(UIKit)
|
|
wantsLayer = true
|
|
#endif
|
|
return layer
|
|
}
|
|
|
|
var cornerRadius: CGFloat {
|
|
get {
|
|
backingLayer?.cornerRadius ?? 0
|
|
}
|
|
set {
|
|
backingLayer?.cornerRadius = newValue
|
|
}
|
|
}
|
|
}
|
|
|
|
@objc public enum ControlEvents: Int {
|
|
case touchDown
|
|
case touchUpInside
|
|
case touchCancel
|
|
case valueChanged
|
|
case primaryActionTriggered
|
|
case mouseEntered
|
|
case mouseExited
|
|
}
|
|
|
|
protocol KSSliderDelegate: AnyObject {
|
|
/**
|
|
call when slider action trigged
|
|
- parameter value: progress
|
|
- parameter event: action
|
|
*/
|
|
func slider(value: Double, event: ControlEvents)
|
|
}
|