Initial commit: SimVision tvOS streaming app
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>
577
KSPlayer-main/Demo/SwiftUI/Player-Info.plist
Normal file
@@ -0,0 +1,577 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mkv</string>
|
||||
<string>mka</string>
|
||||
<string>mk3d</string>
|
||||
<string>mks</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_mkv.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Matroska video</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mka</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_mkv.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Matroska audio</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string></string>
|
||||
</array>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>rm</string>
|
||||
<string>rmvb</string>
|
||||
<string>ra</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_rm.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Real Media file</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>asf</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_asf.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Advanced Systems Format (ASF) media</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>aac</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_aac.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Advanced Audio Coding (AAC) media</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>flv</string>
|
||||
<string>f4v</string>
|
||||
<string>f4p</string>
|
||||
<string>f4a</string>
|
||||
<string>f4b</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_flv.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Flash Video file</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>webm</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_webm.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>WebM media</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>3gp</string>
|
||||
<string>3g2</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_3gp.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>3GPP media</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mp3</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_mp3.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>MPEG Layer III (MP3) audio</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>ogg</string>
|
||||
<string>oga</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_ogg.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>OGG audio</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>ogm</string>
|
||||
<string>ogv</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_ogg.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>OGG video</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>ts</string>
|
||||
<string>mts</string>
|
||||
<string>m2ts</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_ts.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>MPEG transport stream (TS) media</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>avi</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_avi.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>AVI media</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>wav</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_wav.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Waveform Audio File (WAV) audio</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>m4a</string>
|
||||
<string>m4b</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_m4a.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>MPEG-4 audio</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>wmv</string>
|
||||
<string>wma</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_wmv.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Windows Media Video/Audio (WMV/WMA) media</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>qt</string>
|
||||
<string>mov</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_qt.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>QuickTime media</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>flac</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_flac.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Free Lossless Audio Codec (FLAC) audio</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mpeg</string>
|
||||
<string>mpg</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_mp4.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>MPEG video</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mp4</string>
|
||||
<string>m4v</string>
|
||||
<string>m4b</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_mp4.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>MPEG-4 video</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>dat</string>
|
||||
<string>divx</string>
|
||||
<string>vob</string>
|
||||
<string>amv</string>
|
||||
<string>mxf</string>
|
||||
<string>mcf</string>
|
||||
<string>swf</string>
|
||||
<string>xvid</string>
|
||||
<string>yuv</string>
|
||||
<string>dv</string>
|
||||
<string>wv</string>
|
||||
<string>*</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_other_v.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Video file</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>aa3</string>
|
||||
<string>ac3</string>
|
||||
<string>acm</string>
|
||||
<string>aif</string>
|
||||
<string>aiff</string>
|
||||
<string>ape</string>
|
||||
<string>caf</string>
|
||||
<string>mid</string>
|
||||
<string>midi</string>
|
||||
<string>pcm</string>
|
||||
<string>vox</string>
|
||||
<string>tta</string>
|
||||
<string>tak</string>
|
||||
<string>opus</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_other_a.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Audio file</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>m3u8</string>
|
||||
<string>m3u</string>
|
||||
<string>pls</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>doc_list.icns</string>
|
||||
<key>CFBundleTypeIconSystemGenerated</key>
|
||||
<integer>1</integer>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Playlist</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSTypeIsPackage</key>
|
||||
<false/>
|
||||
<key>NSPersistentStoreTypeKey</key>
|
||||
<string>XML</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>Tracy wrapper</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>tracy</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
<key>NSExceptionDomains</key>
|
||||
<dict>
|
||||
<key>tu.rrsub.com</key>
|
||||
<dict>
|
||||
<key>NSIncludesSubdomains</key>
|
||||
<true/>
|
||||
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>NSServices</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSMenuItem</key>
|
||||
<dict>
|
||||
<key>default</key>
|
||||
<string>Player: Open URL</string>
|
||||
</dict>
|
||||
<key>NSMessage</key>
|
||||
<string>droppedText</string>
|
||||
<key>NSSendTypes</key>
|
||||
<array>
|
||||
<string>NSStringPboardType</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>audio</string>
|
||||
<string>fetch</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
34
KSPlayer-main/Demo/SwiftUI/Player.entitlements
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
<key>com.apple.developer.aps-environment</key>
|
||||
<string>development</string>
|
||||
<key>com.apple.developer.icloud-container-identifiers</key>
|
||||
<array/>
|
||||
<key>com.apple.developer.icloud-services</key>
|
||||
<array/>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.assets.movies.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.assets.music.read-only</key>
|
||||
<true/>
|
||||
<key>com.apple.security.assets.pictures.read-only</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.downloads.read-only</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>inter-app-audio</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
459
KSPlayer-main/Demo/SwiftUI/Player.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,459 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
AC43F6412A5172830026ECF2 /* FavoriteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC43F6402A5172830026ECF2 /* FavoriteView.swift */; };
|
||||
AC43F6442A51916F0026ECF2 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = AC43F6422A51916F0026ECF2 /* Model.xcdatamodeld */; };
|
||||
AC43F6662A519D400026ECF2 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC43F6652A519D400026ECF2 /* Persistence.swift */; };
|
||||
AC43F6682A52E86B0026ECF2 /* FilesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC43F6672A52E86B0026ECF2 /* FilesView.swift */; };
|
||||
AC44E0FC29290CBC00617BD3 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC44E0FA29290CBC00617BD3 /* ContentView.swift */; };
|
||||
AC44E0FD29290CF800617BD3 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC44E0F929290CBB00617BD3 /* HomeView.swift */; };
|
||||
AC77DFC326402329001351AE /* TracyApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC77DFB026402327001351AE /* TracyApp.swift */; };
|
||||
AC77DFC526402329001351AE /* URLImportView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC77DFB126402327001351AE /* URLImportView.swift */; };
|
||||
AC77DFC726402329001351AE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AC77DFB226402329001351AE /* Assets.xcassets */; };
|
||||
ACB965472A42EDCD00378A4C /* SettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACB965462A42EDCD00378A4C /* SettingView.swift */; };
|
||||
ACD2F772275F735C0006D16F /* KSPlayer in Frameworks */ = {isa = PBXBuildFile; productRef = ACD2F771275F735C0006D16F /* KSPlayer */; };
|
||||
ACD786492A6A8648004A0220 /* Defaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACD786482A6A8648004A0220 /* Defaults.swift */; };
|
||||
ACEA9FEB298BFC8800FBA74B /* MovieModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACEA9FEA298BFC8800FBA74B /* MovieModel.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
AC43F6402A5172830026ECF2 /* FavoriteView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoriteView.swift; sourceTree = "<group>"; };
|
||||
AC43F6432A51916F0026ECF2 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
|
||||
AC43F6652A519D400026ECF2 /* Persistence.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; };
|
||||
AC43F6672A52E86B0026ECF2 /* FilesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilesView.swift; sourceTree = "<group>"; };
|
||||
AC44E0F929290CBB00617BD3 /* HomeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
|
||||
AC44E0FA29290CBC00617BD3 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
AC77DFB026402327001351AE /* TracyApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TracyApp.swift; sourceTree = "<group>"; };
|
||||
AC77DFB126402327001351AE /* URLImportView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLImportView.swift; sourceTree = "<group>"; };
|
||||
AC77DFB226402329001351AE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
AC77DFB726402329001351AE /* Player.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Player.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
ACADA07528EDC067001B76D1 /* Player.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Player.entitlements; sourceTree = "<group>"; };
|
||||
ACB965462A42EDCD00378A4C /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = "<group>"; };
|
||||
ACD2F747275F6E860006D16F /* KSPlayer */ = {isa = PBXFileReference; lastKnownFileType = folder; name = KSPlayer; path = ../..; sourceTree = "<group>"; };
|
||||
ACD786482A6A8648004A0220 /* Defaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Defaults.swift; sourceTree = "<group>"; };
|
||||
ACE3619328EB689F00F234EB /* Player-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Player-Info.plist"; sourceTree = "<group>"; };
|
||||
ACEA9FEA298BFC8800FBA74B /* MovieModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieModel.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
AC77DFB426402329001351AE /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
ACD2F772275F735C0006D16F /* KSPlayer in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
AC77DFAA26402327001351AE = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
ACADA07528EDC067001B76D1 /* Player.entitlements */,
|
||||
ACE3619328EB689F00F234EB /* Player-Info.plist */,
|
||||
ACD2F743275F6D7A0006D16F /* Packages */,
|
||||
AC77DFAF26402327001351AE /* Shared */,
|
||||
AC77DFB826402329001351AE /* Products */,
|
||||
ACD2F74C275F6EE60006D16F /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AC77DFAF26402327001351AE /* Shared */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
ACEA9FEA298BFC8800FBA74B /* MovieModel.swift */,
|
||||
AC44E0F929290CBB00617BD3 /* HomeView.swift */,
|
||||
AC44E0FA29290CBC00617BD3 /* ContentView.swift */,
|
||||
AC43F6402A5172830026ECF2 /* FavoriteView.swift */,
|
||||
AC43F6672A52E86B0026ECF2 /* FilesView.swift */,
|
||||
AC77DFB026402327001351AE /* TracyApp.swift */,
|
||||
AC77DFB126402327001351AE /* URLImportView.swift */,
|
||||
ACB965462A42EDCD00378A4C /* SettingView.swift */,
|
||||
ACD786482A6A8648004A0220 /* Defaults.swift */,
|
||||
AC43F6652A519D400026ECF2 /* Persistence.swift */,
|
||||
AC77DFB226402329001351AE /* Assets.xcassets */,
|
||||
AC43F6422A51916F0026ECF2 /* Model.xcdatamodeld */,
|
||||
);
|
||||
path = Shared;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AC77DFB826402329001351AE /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AC77DFB726402329001351AE /* Player.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
ACD2F743275F6D7A0006D16F /* Packages */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
ACD2F747275F6E860006D16F /* KSPlayer */,
|
||||
);
|
||||
name = Packages;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
ACD2F74C275F6EE60006D16F /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
AC77DFB626402329001351AE /* Player */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = AC77DFCB26402329001351AE /* Build configuration list for PBXNativeTarget "Player" */;
|
||||
buildPhases = (
|
||||
AC77DFB326402329001351AE /* Sources */,
|
||||
AC77DFB426402329001351AE /* Frameworks */,
|
||||
AC77DFB526402329001351AE /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Player;
|
||||
packageProductDependencies = (
|
||||
ACD2F771275F735C0006D16F /* KSPlayer */,
|
||||
);
|
||||
productName = "demo-SPM (iOS)";
|
||||
productReference = AC77DFB726402329001351AE /* Player.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
AC77DFAB26402327001351AE /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastSwiftUpdateCheck = 1310;
|
||||
LastUpgradeCheck = 1500;
|
||||
TargetAttributes = {
|
||||
AC77DFB626402329001351AE = {
|
||||
CreatedOnToolsVersion = 12.4;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = AC77DFAE26402327001351AE /* Build configuration list for PBXProject "Player" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = AC77DFAA26402327001351AE;
|
||||
productRefGroup = AC77DFB826402329001351AE /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
AC77DFB626402329001351AE /* Player */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
AC77DFB526402329001351AE /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AC77DFC726402329001351AE /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
AC77DFB326402329001351AE /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AC43F6662A519D400026ECF2 /* Persistence.swift in Sources */,
|
||||
AC77DFC526402329001351AE /* URLImportView.swift in Sources */,
|
||||
AC43F6412A5172830026ECF2 /* FavoriteView.swift in Sources */,
|
||||
AC44E0FD29290CF800617BD3 /* HomeView.swift in Sources */,
|
||||
AC43F6682A52E86B0026ECF2 /* FilesView.swift in Sources */,
|
||||
AC43F6442A51916F0026ECF2 /* Model.xcdatamodeld in Sources */,
|
||||
ACEA9FEB298BFC8800FBA74B /* MovieModel.swift in Sources */,
|
||||
ACB965472A42EDCD00378A4C /* SettingView.swift in Sources */,
|
||||
AC44E0FC29290CBC00617BD3 /* ContentView.swift in Sources */,
|
||||
AC77DFC326402329001351AE /* TracyApp.swift in Sources */,
|
||||
ACD786492A6A8648004A0220 /* Defaults.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
AC77DFC926402329001351AE /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.video";
|
||||
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_NAME = Player;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
TVOS_DEPLOYMENT_TARGET = 16.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AC77DFCA26402329001351AE /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.video";
|
||||
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_NAME = Player;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
TVOS_DEPLOYMENT_TARGET = 16.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
AC77DFCC26402329001351AE /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
"ASSETCATALOG_COMPILER_APPICON_NAME[sdk=appletvos*]" = AppIconTVOS;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Player.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 20102;
|
||||
DEVELOPMENT_TEAM = 3RVHT92X9D;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = "Player-Info.plist";
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.video";
|
||||
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
|
||||
INFOPLIST_KEY_UILaunchStoryboardName = " ";
|
||||
INFOPLIST_KEY_UIRequiresFullScreen = YES;
|
||||
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.1.2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.kintan.player;
|
||||
PRODUCT_NAME = Player;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
|
||||
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,3,6,7";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AC77DFCD26402329001351AE /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
"ASSETCATALOG_COMPILER_APPICON_NAME[sdk=appletvos*]" = AppIconTVOS;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Player.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 20102;
|
||||
DEVELOPMENT_TEAM = 3RVHT92X9D;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = "Player-Info.plist";
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.video";
|
||||
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES;
|
||||
INFOPLIST_KEY_UILaunchStoryboardName = " ";
|
||||
INFOPLIST_KEY_UIRequiresFullScreen = YES;
|
||||
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.1.2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.kintan.player;
|
||||
PRODUCT_NAME = Player;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
|
||||
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2,3,6,7";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
AC77DFAE26402327001351AE /* Build configuration list for PBXProject "Player" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AC77DFC926402329001351AE /* Debug */,
|
||||
AC77DFCA26402329001351AE /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
AC77DFCB26402329001351AE /* Build configuration list for PBXNativeTarget "Player" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AC77DFCC26402329001351AE /* Debug */,
|
||||
AC77DFCD26402329001351AE /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCSwiftPackageProductDependency section */
|
||||
ACD2F771275F735C0006D16F /* KSPlayer */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
productName = KSPlayer;
|
||||
};
|
||||
/* End XCSwiftPackageProductDependency section */
|
||||
|
||||
/* Begin XCVersionGroup section */
|
||||
AC43F6422A51916F0026ECF2 /* Model.xcdatamodeld */ = {
|
||||
isa = XCVersionGroup;
|
||||
children = (
|
||||
AC43F6432A51916F0026ECF2 /* Model.xcdatamodel */,
|
||||
);
|
||||
currentVersion = AC43F6432A51916F0026ECF2 /* Model.xcdatamodel */;
|
||||
path = Model.xcdatamodeld;
|
||||
sourceTree = "<group>";
|
||||
versionGroupType = wrapper.xcdatamodel;
|
||||
};
|
||||
/* End XCVersionGroup section */
|
||||
};
|
||||
rootObject = AC77DFAB26402327001351AE /* Project object */;
|
||||
}
|
||||
7
KSPlayer-main/Demo/SwiftUI/Player.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1500"
|
||||
version = "1.7">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AC77DFB626402329001351AE"
|
||||
BuildableName = "Player.app"
|
||||
BlueprintName = "Player"
|
||||
ReferencedContainer = "container:Player.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
shouldAutocreateTestPlan = "YES">
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AC77DFB626402329001351AE"
|
||||
BuildableName = "Player.app"
|
||||
BlueprintName = "Player"
|
||||
ReferencedContainer = "container:Player.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AC77DFB626402329001351AE"
|
||||
BuildableName = "Player.app"
|
||||
BlueprintName = "Player"
|
||||
ReferencedContainer = "container:Player.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "255",
|
||||
"green" : "255",
|
||||
"red" : "255"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "app-icon-1024.png",
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"filename" : "app-icon-32.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "16x16"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"filename" : "app-icon-64.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "32x32"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"filename" : "app-icon-256.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "128x128"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"filename" : "app-icon-512.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "256x256"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "1x",
|
||||
"size" : "512x512"
|
||||
},
|
||||
{
|
||||
"filename" : "app-icon-1024 1.png",
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x",
|
||||
"size" : "512x512"
|
||||
},
|
||||
{
|
||||
"filename" : "app-icon-1024 2.png",
|
||||
"idiom" : "universal",
|
||||
"platform" : "watchos",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 409 B |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 644 B |
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "app-icon-back-1280x768.png",
|
||||
"idiom" : "tv"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"layers" : [
|
||||
{
|
||||
"filename" : "Front.imagestacklayer"
|
||||
},
|
||||
{
|
||||
"filename" : "Middle.imagestacklayer"
|
||||
},
|
||||
{
|
||||
"filename" : "Back.imagestacklayer"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "app-icon-front-1280x768.png",
|
||||
"idiom" : "tv"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.5 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "app-icon-back-400.png",
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "app-icon-back-400@2x.png",
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"layers" : [
|
||||
{
|
||||
"filename" : "Front.imagestacklayer"
|
||||
},
|
||||
{
|
||||
"filename" : "Middle.imagestacklayer"
|
||||
},
|
||||
{
|
||||
"filename" : "Back.imagestacklayer"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "app-icon-front-400.png",
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "app-icon-front-400@2x.png",
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"assets" : [
|
||||
{
|
||||
"filename" : "App Icon - App Store.imagestack",
|
||||
"idiom" : "tv",
|
||||
"role" : "primary-app-icon",
|
||||
"size" : "1280x768"
|
||||
},
|
||||
{
|
||||
"filename" : "App Icon.imagestack",
|
||||
"idiom" : "tv",
|
||||
"role" : "primary-app-icon",
|
||||
"size" : "400x240"
|
||||
},
|
||||
{
|
||||
"filename" : "Top Shelf Image Wide.imageset",
|
||||
"idiom" : "tv",
|
||||
"role" : "top-shelf-image-wide",
|
||||
"size" : "2320x720"
|
||||
},
|
||||
{
|
||||
"filename" : "Top Shelf Image.imageset",
|
||||
"idiom" : "tv",
|
||||
"role" : "top-shelf-image",
|
||||
"size" : "1920x720"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 101 KiB |
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "2320.png",
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "4640.png",
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
166
KSPlayer-main/Demo/SwiftUI/Shared/ContentView.swift
Normal file
@@ -0,0 +1,166 @@
|
||||
import KSPlayer
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
#if !os(tvOS)
|
||||
@Environment(\.openWindow) private var openWindow
|
||||
#endif
|
||||
@EnvironmentObject
|
||||
private var appModel: APPModel
|
||||
private var initialView: some View {
|
||||
#if os(macOS)
|
||||
NavigationSplitView {
|
||||
List(selection: $appModel.tabSelected) {
|
||||
link(to: .Home)
|
||||
link(to: .Favorite)
|
||||
link(to: .Files)
|
||||
}
|
||||
} detail: {
|
||||
appModel.tabSelected.destination(appModel: appModel)
|
||||
}
|
||||
#else
|
||||
TabView(selection: $appModel.tabSelected) {
|
||||
tab(to: .Home)
|
||||
tab(to: .Favorite)
|
||||
tab(to: .Files)
|
||||
tab(to: .Setting)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
initialView
|
||||
.preferredColorScheme(.dark)
|
||||
.background(Color.black)
|
||||
.sheet(isPresented: $appModel.openURLImport) {
|
||||
URLImportView()
|
||||
}
|
||||
.onChange(of: appModel.openURL) { url in
|
||||
if let url {
|
||||
#if !os(tvOS)
|
||||
openWindow(value: url)
|
||||
#endif
|
||||
appModel.openURL = nil
|
||||
}
|
||||
}
|
||||
.onChange(of: appModel.openPlayModel) { model in
|
||||
if let model {
|
||||
#if !os(tvOS)
|
||||
openWindow(value: model)
|
||||
#endif
|
||||
appModel.openPlayModel = nil
|
||||
}
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.onDrop(of: ["public.url", "public.file-url"], isTargeted: nil) { items -> Bool in
|
||||
guard let item = items.first, let identifier = item.registeredTypeIdentifiers.first else {
|
||||
return false
|
||||
}
|
||||
item.loadItem(forTypeIdentifier: identifier, options: nil) { urlData, _ in
|
||||
if let urlData = urlData as? Data {
|
||||
let url = NSURL(absoluteURLWithDataRepresentation: urlData, relativeTo: nil) as URL
|
||||
DispatchQueue.main.async {
|
||||
appModel.open(url: url)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
.fileImporter(isPresented: $appModel.openFileImport, allowedContentTypes: [.movie, .audio, .data]) { result in
|
||||
guard let url = try? result.get() else {
|
||||
return
|
||||
}
|
||||
if url.startAccessingSecurityScopedResource() {
|
||||
appModel.open(url: url)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
.onOpenURL { url in
|
||||
KSLog("onOpenURL")
|
||||
appModel.open(url: url)
|
||||
}
|
||||
}
|
||||
|
||||
func link(to item: TabBarItem) -> some View {
|
||||
item.lable.tag(item)
|
||||
}
|
||||
|
||||
func tab(to item: TabBarItem) -> some View {
|
||||
Group {
|
||||
if item == .Home {
|
||||
NavigationStack(path: $appModel.path) {
|
||||
item.destination(appModel: appModel)
|
||||
}
|
||||
} else {
|
||||
NavigationStack {
|
||||
item.destination(appModel: appModel)
|
||||
}
|
||||
}
|
||||
}
|
||||
.tabItem {
|
||||
item.lable.tag(item)
|
||||
}.tag(item)
|
||||
}
|
||||
}
|
||||
|
||||
enum TabBarItem: Int {
|
||||
case Home
|
||||
case Favorite
|
||||
case Files
|
||||
case Setting
|
||||
var lable: Label<Text, Image> {
|
||||
switch self {
|
||||
case .Home:
|
||||
return Label("Home", systemImage: "house.fill")
|
||||
case .Favorite:
|
||||
return Label("Favorite", systemImage: "star.fill")
|
||||
case .Files:
|
||||
return Label("Files", systemImage: "folder.fill.badge.gearshape")
|
||||
case .Setting:
|
||||
return Label("Setting", systemImage: "gear")
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
@ViewBuilder
|
||||
func destination(appModel: APPModel) -> some View {
|
||||
switch self {
|
||||
case .Home:
|
||||
HomeView(m3uURL: appModel.activeM3UModel?.m3uURL)
|
||||
.navigationPlay()
|
||||
case .Favorite:
|
||||
FavoriteView()
|
||||
.navigationPlay()
|
||||
case .Files:
|
||||
FilesView()
|
||||
case .Setting:
|
||||
SettingView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public extension View {
|
||||
@MainActor
|
||||
@ViewBuilder
|
||||
func navigationPlay() -> some View {
|
||||
navigationDestination(for: URL.self) { url in
|
||||
KSVideoPlayerView(url: url)
|
||||
#if !os(macOS)
|
||||
.toolbar(.hidden, for: .tabBar)
|
||||
#endif
|
||||
}
|
||||
.navigationDestination(for: MovieModel.self) { model in
|
||||
model.view
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension MovieModel {
|
||||
@MainActor
|
||||
var view: some View {
|
||||
KSVideoPlayerView(model: self)
|
||||
#if !os(macOS)
|
||||
.toolbar(.hidden, for: .tabBar)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
225
KSPlayer-main/Demo/SwiftUI/Shared/Defaults.swift
Normal file
@@ -0,0 +1,225 @@
|
||||
//
|
||||
// Defaults.swift
|
||||
// TracyPlayer
|
||||
//
|
||||
// Created by kintan on 2023/7/21.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import KSPlayer
|
||||
import SwiftUI
|
||||
|
||||
public class Defaults: ObservableObject {
|
||||
@AppStorage("showRecentPlayList") public var showRecentPlayList = false
|
||||
|
||||
@AppStorage("hardwareDecode")
|
||||
public var hardwareDecode = KSOptions.hardwareDecode {
|
||||
didSet {
|
||||
KSOptions.hardwareDecode = hardwareDecode
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("asynchronousDecompression")
|
||||
public var asynchronousDecompression = KSOptions.asynchronousDecompression {
|
||||
didSet {
|
||||
KSOptions.asynchronousDecompression = asynchronousDecompression
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("isUseDisplayLayer")
|
||||
public var isUseDisplayLayer = MEOptions.isUseDisplayLayer {
|
||||
didSet {
|
||||
MEOptions.isUseDisplayLayer = isUseDisplayLayer
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("preferredForwardBufferDuration")
|
||||
public var preferredForwardBufferDuration = KSOptions.preferredForwardBufferDuration {
|
||||
didSet {
|
||||
KSOptions.preferredForwardBufferDuration = preferredForwardBufferDuration
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("maxBufferDuration")
|
||||
public var maxBufferDuration = KSOptions.maxBufferDuration {
|
||||
didSet {
|
||||
KSOptions.maxBufferDuration = maxBufferDuration
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("isLoopPlay")
|
||||
public var isLoopPlay = KSOptions.isLoopPlay {
|
||||
didSet {
|
||||
KSOptions.isLoopPlay = isLoopPlay
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("canBackgroundPlay")
|
||||
public var canBackgroundPlay = true {
|
||||
didSet {
|
||||
KSOptions.canBackgroundPlay = canBackgroundPlay
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("isAutoPlay")
|
||||
public var isAutoPlay = true {
|
||||
didSet {
|
||||
KSOptions.isAutoPlay = isAutoPlay
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("isSecondOpen")
|
||||
public var isSecondOpen = true {
|
||||
didSet {
|
||||
KSOptions.isSecondOpen = isSecondOpen
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("isAccurateSeek")
|
||||
public var isAccurateSeek = true {
|
||||
didSet {
|
||||
KSOptions.isAccurateSeek = isAccurateSeek
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("isPipPopViewController")
|
||||
public var isPipPopViewController = true {
|
||||
didSet {
|
||||
KSOptions.isPipPopViewController = isPipPopViewController
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("textFontSize")
|
||||
public var textFontSize = SubtitleModel.textFontSize {
|
||||
didSet {
|
||||
SubtitleModel.textFontSize = textFontSize
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("textBold")
|
||||
public var textBold = SubtitleModel.textBold {
|
||||
didSet {
|
||||
SubtitleModel.textBold = textBold
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("textItalic")
|
||||
public var textItalic = SubtitleModel.textItalic {
|
||||
didSet {
|
||||
SubtitleModel.textItalic = textItalic
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("textColor")
|
||||
public var textColor = SubtitleModel.textColor {
|
||||
didSet {
|
||||
SubtitleModel.textColor = textColor
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("textBackgroundColor")
|
||||
public var textBackgroundColor = SubtitleModel.textBackgroundColor {
|
||||
didSet {
|
||||
SubtitleModel.textBackgroundColor = textBackgroundColor
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("horizontalAlign")
|
||||
public var horizontalAlign = SubtitleModel.textPosition.horizontalAlign {
|
||||
didSet {
|
||||
SubtitleModel.textPosition.horizontalAlign = horizontalAlign
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("verticalAlign")
|
||||
public var verticalAlign = SubtitleModel.textPosition.verticalAlign {
|
||||
didSet {
|
||||
SubtitleModel.textPosition.verticalAlign = verticalAlign
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("leftMargin")
|
||||
public var leftMargin = SubtitleModel.textPosition.leftMargin {
|
||||
didSet {
|
||||
SubtitleModel.textPosition.leftMargin = leftMargin
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("rightMargin")
|
||||
public var rightMargin = SubtitleModel.textPosition.rightMargin {
|
||||
didSet {
|
||||
SubtitleModel.textPosition.rightMargin = rightMargin
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("verticalMargin")
|
||||
public var verticalMargin = SubtitleModel.textPosition.verticalMargin {
|
||||
didSet {
|
||||
SubtitleModel.textPosition.verticalMargin = verticalMargin
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("yadifMode")
|
||||
public var yadifMode = MEOptions.yadifMode {
|
||||
didSet {
|
||||
MEOptions.yadifMode = yadifMode
|
||||
}
|
||||
}
|
||||
|
||||
@AppStorage("audioPlayerType")
|
||||
public var audioPlayerType = NSStringFromClass(KSOptions.audioPlayerType) {
|
||||
didSet {
|
||||
KSOptions.audioPlayerType = NSClassFromString(audioPlayerType) as! any AudioOutput.Type
|
||||
}
|
||||
}
|
||||
|
||||
public static let shared = Defaults()
|
||||
private init() {
|
||||
KSOptions.hardwareDecode = hardwareDecode
|
||||
MEOptions.isUseDisplayLayer = isUseDisplayLayer
|
||||
SubtitleModel.textFontSize = textFontSize
|
||||
SubtitleModel.textBold = textBold
|
||||
SubtitleModel.textItalic = textItalic
|
||||
SubtitleModel.textColor = textColor
|
||||
SubtitleModel.textBackgroundColor = textBackgroundColor
|
||||
SubtitleModel.textPosition.horizontalAlign = horizontalAlign
|
||||
SubtitleModel.textPosition.verticalAlign = verticalAlign
|
||||
SubtitleModel.textPosition.leftMargin = leftMargin
|
||||
SubtitleModel.textPosition.rightMargin = rightMargin
|
||||
SubtitleModel.textPosition.verticalMargin = verticalMargin
|
||||
KSOptions.preferredForwardBufferDuration = preferredForwardBufferDuration
|
||||
KSOptions.maxBufferDuration = maxBufferDuration
|
||||
KSOptions.isLoopPlay = isLoopPlay
|
||||
KSOptions.canBackgroundPlay = canBackgroundPlay
|
||||
KSOptions.isAutoPlay = isAutoPlay
|
||||
KSOptions.isSecondOpen = isSecondOpen
|
||||
KSOptions.isAccurateSeek = isAccurateSeek
|
||||
KSOptions.isPipPopViewController = isPipPopViewController
|
||||
MEOptions.yadifMode = yadifMode
|
||||
KSOptions.audioPlayerType = NSClassFromString(audioPlayerType) as! any AudioOutput.Type
|
||||
}
|
||||
}
|
||||
|
||||
@propertyWrapper
|
||||
public struct Default<T>: DynamicProperty {
|
||||
@ObservedObject private var defaults: Defaults
|
||||
private let keyPath: ReferenceWritableKeyPath<Defaults, T>
|
||||
public init(_ keyPath: ReferenceWritableKeyPath<Defaults, T>, defaults: Defaults = .shared) {
|
||||
self.keyPath = keyPath
|
||||
self.defaults = defaults
|
||||
}
|
||||
|
||||
public var wrappedValue: T {
|
||||
get { defaults[keyPath: keyPath] }
|
||||
nonmutating set { defaults[keyPath: keyPath] = newValue }
|
||||
}
|
||||
|
||||
public var projectedValue: Binding<T> {
|
||||
Binding(
|
||||
get: { defaults[keyPath: keyPath] },
|
||||
set: { value in
|
||||
defaults[keyPath: keyPath] = value
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
38
KSPlayer-main/Demo/SwiftUI/Shared/FavoriteView.swift
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// FavoriteView.swift
|
||||
// TracyPlayer
|
||||
//
|
||||
// Created by kintan on 2023/7/2.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct FavoriteView: View {
|
||||
@EnvironmentObject
|
||||
private var appModel: APPModel
|
||||
@State
|
||||
private var nameFilter: String = ""
|
||||
@FetchRequest(
|
||||
sortDescriptors: [NSSortDescriptor(keyPath: \MovieModel.name, ascending: true)],
|
||||
predicate: NSPredicate(format: "playmodel.isFavorite == YES")
|
||||
)
|
||||
private var favoritelist: FetchedResults<MovieModel>
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
LazyVGrid(columns: [GridItem(.adaptive(minimum: MoiveView.width))]) {
|
||||
let playlist = favoritelist.filter { model in
|
||||
var isIncluded = true
|
||||
if !nameFilter.isEmpty {
|
||||
isIncluded = model.name!.contains(nameFilter)
|
||||
}
|
||||
return isIncluded
|
||||
}
|
||||
ForEach(playlist) { model in
|
||||
appModel.content(model: model)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.searchable(text: $nameFilter)
|
||||
}
|
||||
}
|
||||
172
KSPlayer-main/Demo/SwiftUI/Shared/FilesView.swift
Normal file
@@ -0,0 +1,172 @@
|
||||
//
|
||||
// FilesView.swift
|
||||
// TracyPlayer
|
||||
//
|
||||
// Created by kintan on 2023/7/3.
|
||||
//
|
||||
|
||||
import KSPlayer
|
||||
import SwiftUI
|
||||
|
||||
struct FilesView: View {
|
||||
@FetchRequest(
|
||||
sortDescriptors: [NSSortDescriptor(keyPath: \M3UModel.name, ascending: true)],
|
||||
predicate: NSPredicate(format: "m3uURL != nil && name != nil")
|
||||
)
|
||||
private var m3uModels: FetchedResults<M3UModel>
|
||||
@EnvironmentObject
|
||||
private var appModel: APPModel
|
||||
@State
|
||||
private var addM3U = false
|
||||
@State
|
||||
private var openFileImport = false
|
||||
@State
|
||||
private var nameFilter: String = ""
|
||||
var body: some View {
|
||||
let models = m3uModels.filter { model in
|
||||
var isIncluded = true
|
||||
if !nameFilter.isEmpty {
|
||||
isIncluded = model.name!.contains(nameFilter)
|
||||
}
|
||||
return isIncluded
|
||||
}
|
||||
#if os(tvOS)
|
||||
HStack {
|
||||
toolbarView
|
||||
}
|
||||
#endif
|
||||
List(models, id: \.self, selection: $appModel.activeM3UModel) { model in
|
||||
#if os(tvOS)
|
||||
NavigationLink(value: model) {
|
||||
M3UView(model: model)
|
||||
}
|
||||
#else
|
||||
M3UView(model: model)
|
||||
#endif
|
||||
}
|
||||
.searchable(text: $nameFilter)
|
||||
.sheet(isPresented: $addM3U) {
|
||||
AddM3UView()
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.toolbar {
|
||||
toolbarView
|
||||
}
|
||||
.fileImporter(isPresented: $openFileImport, allowedContentTypes: [.data]) { result in
|
||||
guard let url = try? result.get() else {
|
||||
return
|
||||
}
|
||||
appModel.addM3U(url: url)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private var toolbarView: some View {
|
||||
Group {
|
||||
Button {
|
||||
openFileImport = true
|
||||
} label: {
|
||||
Label("Add Local M3U", systemImage: "plus.rectangle.on.folder.fill")
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.keyboardShortcut("o")
|
||||
#endif
|
||||
Button {
|
||||
addM3U = true
|
||||
} label: {
|
||||
Label("Add Remote M3U", systemImage: "plus.app.fill")
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.keyboardShortcut("o", modifiers: [.command, .shift])
|
||||
#endif
|
||||
}
|
||||
.labelStyle(.titleAndIcon)
|
||||
}
|
||||
}
|
||||
|
||||
struct M3UView: View {
|
||||
@ObservedObject
|
||||
var model: M3UModel
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
Text(model.name ?? "")
|
||||
.font(.title2)
|
||||
.foregroundColor(.primary)
|
||||
Text("total \(model.count) channels")
|
||||
.font(.callout)
|
||||
.foregroundColor(.secondary)
|
||||
Text(model.m3uURL?.description ?? "")
|
||||
.font(.callout)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.contextMenu {
|
||||
if PersistenceController.shared.container.canUpdateRecord(forManagedObjectWith: model.objectID) {
|
||||
Button {
|
||||
model.delete()
|
||||
} label: {
|
||||
Label("Delete", systemImage: "trash.fill")
|
||||
}
|
||||
}
|
||||
Button {
|
||||
Task {
|
||||
try? await _ = model.parsePlaylist()
|
||||
}
|
||||
} label: {
|
||||
Label("Refresh", systemImage: "arrow.clockwise.circle")
|
||||
}
|
||||
#if !os(tvOS)
|
||||
Button {
|
||||
#if os(macOS)
|
||||
UIPasteboard.general.clearContents()
|
||||
UIPasteboard.general.setString(model.m3uURL!.description, forType: .string)
|
||||
#else
|
||||
UIPasteboard.general.setValue(model.m3uURL!, forPasteboardType: "public.url")
|
||||
#endif
|
||||
} label: {
|
||||
Label("Copy url", systemImage: "doc.on.doc.fill")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct AddM3UView: View {
|
||||
#if DEBUG && targetEnvironment(simulator)
|
||||
@State
|
||||
private var url = "https://raw.githubusercontent.com/kingslay/TestVideo/main/TestVideo.m3u"
|
||||
#else
|
||||
@State
|
||||
private var url = ""
|
||||
#endif
|
||||
@State
|
||||
private var name = ""
|
||||
@EnvironmentObject private var appModel: APPModel
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
var body: some View {
|
||||
Form {
|
||||
Section {
|
||||
TextField("URL", text: $url)
|
||||
TextField("Name", text: $name)
|
||||
}
|
||||
Section {
|
||||
Text("Links to playlists you add will be public. All people can see it. But only you can modify and delete")
|
||||
Button("Done") {
|
||||
if let url = URL(string: url.trimmingCharacters(in: NSMutableCharacterSet.whitespacesAndNewlines)) {
|
||||
let name = name.trimmingCharacters(in: NSMutableCharacterSet.whitespacesAndNewlines)
|
||||
appModel.addM3U(url: url, name: name.isEmpty ? nil : name)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
#endif
|
||||
#if os(macOS) || targetEnvironment(macCatalyst)
|
||||
Button("Cancel") {
|
||||
dismiss()
|
||||
}
|
||||
.keyboardShortcut(.cancelAction)
|
||||
#endif
|
||||
}
|
||||
}.padding()
|
||||
}
|
||||
}
|
||||
185
KSPlayer-main/Demo/SwiftUI/Shared/HomeView.swift
Normal file
@@ -0,0 +1,185 @@
|
||||
import KSPlayer
|
||||
import SwiftUI
|
||||
|
||||
struct HomeView: View {
|
||||
@EnvironmentObject
|
||||
private var appModel: APPModel
|
||||
@State
|
||||
private var nameFilter: String = ""
|
||||
@State
|
||||
private var groupFilter: String?
|
||||
@Default(\.showRecentPlayList)
|
||||
private var showRecentPlayList
|
||||
// @Environment(\.horizontalSizeClass) var horizontalSizeClass
|
||||
@FetchRequest(fetchRequest: MovieModel.playTimeRequest)
|
||||
private var historyModels: FetchedResults<MovieModel>
|
||||
@FetchRequest
|
||||
private var movieModels: FetchedResults<MovieModel>
|
||||
init(m3uURL: URL?) {
|
||||
let request = MovieModel.fetchRequest()
|
||||
request.sortDescriptors = [NSSortDescriptor(keyPath: \MovieModel.name, ascending: true)]
|
||||
request.predicate = NSPredicate(format: "m3uURL == %@ && name != nil ", m3uURL?.description ?? "nil")
|
||||
_movieModels = FetchRequest<MovieModel>(fetchRequest: request)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
#if os(tvOS)
|
||||
HStack {
|
||||
toolbarView
|
||||
}
|
||||
#endif
|
||||
if showRecentPlayList {
|
||||
Section {
|
||||
ScrollView(.horizontal) {
|
||||
LazyHStack {
|
||||
ForEach(historyModels) { model in
|
||||
appModel.content(model: model)
|
||||
}
|
||||
}
|
||||
}
|
||||
} header: {
|
||||
HStack {
|
||||
Text("Recent Play").font(.title)
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal)
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
Section {
|
||||
LazyVGrid(columns: [GridItem(.adaptive(minimum: MoiveView.width))]) {
|
||||
let playlist = movieModels.filter { model in
|
||||
var isIncluded = true
|
||||
if !nameFilter.isEmpty {
|
||||
isIncluded = model.name!.contains(nameFilter)
|
||||
}
|
||||
if let groupFilter {
|
||||
isIncluded = isIncluded && model.group == groupFilter
|
||||
}
|
||||
return isIncluded
|
||||
}
|
||||
ForEach(playlist) { model in
|
||||
appModel.content(model: model)
|
||||
}
|
||||
}
|
||||
|
||||
} header: {
|
||||
HStack {
|
||||
Text("Channels").font(.title)
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal)
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
#if !os(tvOS)
|
||||
// tvos如果加searchable。那就会导致滚动错乱,所以只能去掉了
|
||||
.searchable(text: $nameFilter)
|
||||
.toolbar {
|
||||
toolbarView
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private var toolbarView: some View {
|
||||
Group {
|
||||
Button {
|
||||
appModel.openFileImport = true
|
||||
} label: {
|
||||
Label("Open File", systemImage: "plus.rectangle.on.folder.fill")
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.keyboardShortcut("o")
|
||||
#endif
|
||||
Button {
|
||||
appModel.openURLImport = true
|
||||
} label: {
|
||||
Label("Open URL", systemImage: "plus.app.fill")
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.keyboardShortcut("o", modifiers: [.command, .shift])
|
||||
#endif
|
||||
let groups = movieModels.reduce(Set<String>()) { partialResult, model in
|
||||
if let group = model.group {
|
||||
var set = partialResult
|
||||
set.insert(group)
|
||||
return set
|
||||
} else {
|
||||
return partialResult
|
||||
}
|
||||
}.sorted()
|
||||
Picker("group filter", selection: $groupFilter) {
|
||||
Text("All").tag(nil as String?)
|
||||
ForEach(groups) { group in
|
||||
Text(group).tag(group as String?)
|
||||
}
|
||||
}
|
||||
#if os(tvOS)
|
||||
.pickerStyle(.navigationLink)
|
||||
#endif
|
||||
}
|
||||
.labelStyle(.titleAndIcon)
|
||||
}
|
||||
}
|
||||
|
||||
struct MoiveView: View {
|
||||
static let width: CGFloat = {
|
||||
#if canImport(UIKit)
|
||||
if UIDevice.current.userInterfaceIdiom == .phone {
|
||||
return min(KSOptions.sceneSize.width, KSOptions.sceneSize.height) / 2 - 20
|
||||
} else if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
return min(KSOptions.sceneSize.width, KSOptions.sceneSize.height) / 3 - 20
|
||||
} else if UIDevice.current.userInterfaceIdiom == .tv {
|
||||
return KSOptions.sceneSize.width / 4 - 150
|
||||
} else if UIDevice.current.userInterfaceIdiom == .mac {
|
||||
return CGFloat(192)
|
||||
} else {
|
||||
return CGFloat(192)
|
||||
}
|
||||
#else
|
||||
return CGFloat(192)
|
||||
#endif
|
||||
}()
|
||||
|
||||
@ObservedObject var model: MovieModel
|
||||
var body: some View {
|
||||
VStack {
|
||||
image
|
||||
Text(model.name ?? "").lineLimit(1)
|
||||
}
|
||||
.frame(width: MoiveView.width)
|
||||
.contextMenu {
|
||||
Button {
|
||||
model.isFavorite.toggle()
|
||||
try? model.managedObjectContext?.save()
|
||||
} label: {
|
||||
let isFavorite = model.isFavorite
|
||||
Label(isFavorite ? "Cancel favorite" : "Favorite", systemImage: isFavorite ? "star" : "star.fill")
|
||||
}
|
||||
#if !os(tvOS)
|
||||
Button {
|
||||
#if os(macOS)
|
||||
UIPasteboard.general.clearContents()
|
||||
UIPasteboard.general.setString(model.url!.description, forType: .string)
|
||||
#else
|
||||
UIPasteboard.general.setValue(model.url!, forPasteboardType: "public.url")
|
||||
#endif
|
||||
} label: {
|
||||
Label("Copy url", systemImage: "doc.on.doc.fill")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
var image: some View {
|
||||
AsyncImage(url: model.logo) { image in
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
} placeholder: {
|
||||
Color.gray
|
||||
}.frame(width: MoiveView.width, height: MoiveView.width / 16 * 9)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 5))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22222" systemVersion="23A344" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithSwiftData="YES" userDefinedModelVersionIdentifier="">
|
||||
<entity name="M3UModel" representedClassName="M3UModel" syncable="YES" codeGenerationType="class">
|
||||
<attribute name="count" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="m3uURL" optional="YES" attributeType="URI"/>
|
||||
<attribute name="name" attributeType="String" defaultValueString=""/>
|
||||
</entity>
|
||||
<entity name="MovieModel" representedClassName="MovieModel" syncable="YES" codeGenerationType="category">
|
||||
<attribute name="country" optional="YES" attributeType="String"/>
|
||||
<attribute name="group" optional="YES" attributeType="String"/>
|
||||
<attribute name="httpReferer" optional="YES" attributeType="String"/>
|
||||
<attribute name="httpUserAgent" optional="YES" attributeType="String"/>
|
||||
<attribute name="language" optional="YES" attributeType="String"/>
|
||||
<attribute name="logo" optional="YES" attributeType="URI"/>
|
||||
<attribute name="m3uURL" optional="YES" attributeType="URI"/>
|
||||
<attribute name="name" attributeType="String" defaultValueString=""/>
|
||||
<attribute name="tvgID" optional="YES" attributeType="String"/>
|
||||
<attribute name="url" optional="YES" attributeType="URI"/>
|
||||
<relationship name="playmodel" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="PlayModel" inverseName="url" inverseEntity="PlayModel"/>
|
||||
</entity>
|
||||
<entity name="PlayModel" representedClassName="PlayModel" syncable="YES" codeGenerationType="class">
|
||||
<attribute name="current" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="duration" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="isFavorite" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||
<attribute name="playTime" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
||||
<relationship name="url" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="MovieModel" inverseName="playmodel" inverseEntity="MovieModel"/>
|
||||
</entity>
|
||||
<configuration name="local">
|
||||
<memberEntity name="MovieModel"/>
|
||||
</configuration>
|
||||
<configuration name="private" usedWithCloudKit="YES">
|
||||
<memberEntity name="MovieModel"/>
|
||||
<memberEntity name="PlayModel"/>
|
||||
</configuration>
|
||||
<configuration name="public" usedWithCloudKit="YES">
|
||||
<memberEntity name="M3UModel"/>
|
||||
</configuration>
|
||||
</model>
|
||||
306
KSPlayer-main/Demo/SwiftUI/Shared/MovieModel.swift
Normal file
@@ -0,0 +1,306 @@
|
||||
//
|
||||
// MovieModel.swift
|
||||
// TracyPlayer
|
||||
//
|
||||
// Created by kintan on 2023/2/2.
|
||||
//
|
||||
|
||||
import CoreData
|
||||
import CoreMedia
|
||||
import Foundation
|
||||
import KSPlayer
|
||||
#if canImport(UIKit)
|
||||
import UIKit
|
||||
#endif
|
||||
class MEOptions: KSOptions {
|
||||
#if os(iOS)
|
||||
static var isUseDisplayLayer = true
|
||||
#else
|
||||
static var isUseDisplayLayer = false
|
||||
#endif
|
||||
override init() {
|
||||
super.init()
|
||||
}
|
||||
|
||||
override func process(assetTrack: some MediaPlayerTrack) {
|
||||
super.process(assetTrack: assetTrack)
|
||||
}
|
||||
|
||||
override func isUseDisplayLayer() -> Bool {
|
||||
MEOptions.isUseDisplayLayer && display == .plane
|
||||
}
|
||||
}
|
||||
|
||||
@objc(MovieModel)
|
||||
public class MovieModel: NSManagedObject, Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case name, url, httpReferer, httpUserAgent
|
||||
}
|
||||
|
||||
public required convenience init(from decoder: Decoder) throws {
|
||||
self.init(context: PersistenceController.shared.viewContext)
|
||||
let values = try decoder.container(keyedBy: CodingKeys.self)
|
||||
url = try values.decode(URL.self, forKey: .url)
|
||||
name = try values.decode(String.self, forKey: .name)
|
||||
httpReferer = try values.decode(String.self, forKey: .httpReferer)
|
||||
httpUserAgent = try values.decode(String.self, forKey: .httpUserAgent)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(url, forKey: .url)
|
||||
try container.encode(name, forKey: .name)
|
||||
try container.encode(httpReferer, forKey: .httpReferer)
|
||||
try container.encode(httpUserAgent, forKey: .httpUserAgent)
|
||||
}
|
||||
}
|
||||
|
||||
extension MovieModel {
|
||||
convenience init(context: NSManagedObjectContext = PersistenceController.shared.viewContext, url: URL) {
|
||||
self.init(context: context, url: url, name: url.lastPathComponent)
|
||||
}
|
||||
|
||||
convenience init(context: NSManagedObjectContext = PersistenceController.shared.viewContext, url: URL, name: String, extinf: [String: String]? = nil) {
|
||||
self.init(context: context)
|
||||
self.name = name
|
||||
self.url = url
|
||||
setExt(info: extinf)
|
||||
}
|
||||
|
||||
func setExt(info: [String: String]? = nil) {
|
||||
let logo = info?["tvg-logo"].flatMap { URL(string: $0) }
|
||||
if logo != self.logo {
|
||||
self.logo = logo
|
||||
}
|
||||
let language = info?["tvg-language"]
|
||||
if language != self.language {
|
||||
self.language = language
|
||||
}
|
||||
let country = info?["tvg-country"]
|
||||
if country != self.country {
|
||||
self.country = country
|
||||
}
|
||||
let group = info?["group-title"]
|
||||
if group != self.group {
|
||||
self.group = group
|
||||
}
|
||||
let tvgID = info?["tvg-id"]
|
||||
if tvgID != self.tvgID {
|
||||
self.tvgID = tvgID
|
||||
}
|
||||
let httpReferer = info?["http-referrer"] ?? info?["http-referer"]
|
||||
if httpReferer != self.httpReferer {
|
||||
self.httpReferer = httpReferer
|
||||
}
|
||||
let httpUserAgent = info?["http-user-agent"]
|
||||
if httpUserAgent != self.httpUserAgent {
|
||||
self.httpUserAgent = httpUserAgent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension M3UModel {
|
||||
convenience init(context: NSManagedObjectContext = PersistenceController.shared.viewContext, url: URL, name: String? = nil) {
|
||||
self.init(context: context)
|
||||
self.name = name ?? url.lastPathComponent
|
||||
m3uURL = url
|
||||
}
|
||||
|
||||
func delete() {
|
||||
guard let context = managedObjectContext, let m3uURL else {
|
||||
return
|
||||
}
|
||||
context.delete(self)
|
||||
let request = M3UModel.fetchRequest()
|
||||
request.predicate = NSPredicate(format: "m3uURL == %@", m3uURL.description)
|
||||
do {
|
||||
if let array = try? context.fetch(request), array.isEmpty {
|
||||
let movieRequest = NSFetchRequest<MovieModel>(entityName: "MovieModel")
|
||||
movieRequest.predicate = NSPredicate(format: "m3uURL == %@", m3uURL.description)
|
||||
for model in try context.fetch(movieRequest) {
|
||||
context.delete(model)
|
||||
}
|
||||
// let deleteRequest = NSBatchDeleteRequest(fetchRequest: movieRequest)
|
||||
// _ = try? context.execute(deleteRequest)
|
||||
}
|
||||
try context.save()
|
||||
} catch {
|
||||
KSLog(level: .error, error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
func getMovieModels() async -> [MovieModel] {
|
||||
let viewContext = managedObjectContext ?? PersistenceController.shared.viewContext
|
||||
let m3uURL = await viewContext.perform {
|
||||
self.m3uURL
|
||||
}
|
||||
guard let m3uURL else {
|
||||
return []
|
||||
}
|
||||
return await viewContext.perform {
|
||||
let request = NSFetchRequest<MovieModel>(entityName: "MovieModel")
|
||||
request.predicate = NSPredicate(format: "m3uURL == %@", m3uURL.description)
|
||||
request.sortDescriptors = [NSSortDescriptor(key: "name", ascending: true)]
|
||||
return (try? viewContext.fetch(request)) ?? []
|
||||
}
|
||||
}
|
||||
|
||||
func parsePlaylist() async throws -> [MovieModel] {
|
||||
let array = await getMovieModels()
|
||||
let viewContext = managedObjectContext ?? PersistenceController.shared.viewContext
|
||||
let m3uURL = await viewContext.perform {
|
||||
self.m3uURL
|
||||
}
|
||||
guard let m3uURL else {
|
||||
return []
|
||||
}
|
||||
let result = try await m3uURL.parsePlaylist()
|
||||
guard result.count > 0 else {
|
||||
delete()
|
||||
return []
|
||||
}
|
||||
return await viewContext.perform {
|
||||
var dic = [URL?: MovieModel]()
|
||||
for model in array {
|
||||
if let oldModel = dic[model.url] {
|
||||
if oldModel.playmodel == nil {
|
||||
viewContext.delete(oldModel)
|
||||
dic[model.url] = model
|
||||
} else {
|
||||
viewContext.delete(model)
|
||||
}
|
||||
} else {
|
||||
dic[model.url] = model
|
||||
}
|
||||
}
|
||||
let models = result.map { name, url, extinf -> MovieModel in
|
||||
if let model = dic[url] {
|
||||
dic.removeValue(forKey: url)
|
||||
if name != model.name {
|
||||
model.name = name
|
||||
}
|
||||
model.setExt(info: extinf)
|
||||
return model
|
||||
} else {
|
||||
let model = MovieModel(context: viewContext, url: url, name: name, extinf: extinf)
|
||||
model.m3uURL = self.m3uURL
|
||||
return model
|
||||
}
|
||||
}
|
||||
if self.count != Int32(models.count) {
|
||||
self.count = Int32(models.count)
|
||||
}
|
||||
viewContext.perform {
|
||||
if viewContext.hasChanges {
|
||||
for model in dic.values {
|
||||
viewContext.delete(model)
|
||||
}
|
||||
try? viewContext.save()
|
||||
}
|
||||
}
|
||||
return models
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension MovieModel {
|
||||
static var playTimeRequest: NSFetchRequest<MovieModel> {
|
||||
let request = MovieModel.fetchRequest()
|
||||
request.sortDescriptors = [
|
||||
NSSortDescriptor(
|
||||
keyPath: \MovieModel.playmodel?.playTime,
|
||||
ascending: false
|
||||
),
|
||||
]
|
||||
request.predicate = NSPredicate(format: "playmodel.playTime != nil")
|
||||
request.fetchLimit = 20
|
||||
return request
|
||||
}
|
||||
|
||||
public var isFavorite: Bool {
|
||||
get {
|
||||
playmodel?.isFavorite ?? false
|
||||
}
|
||||
set {
|
||||
let playmodel = getPlaymodel()
|
||||
playmodel.isFavorite = newValue
|
||||
}
|
||||
}
|
||||
|
||||
func getPlaymodel() -> PlayModel {
|
||||
if let playmodel {
|
||||
return playmodel
|
||||
}
|
||||
let model = PlayModel()
|
||||
playmodel = model
|
||||
model.save()
|
||||
return model
|
||||
}
|
||||
}
|
||||
|
||||
extension NSManagedObject {
|
||||
func save() {
|
||||
guard let context = managedObjectContext else {
|
||||
return
|
||||
}
|
||||
context.perform {
|
||||
do {
|
||||
try context.save()
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension PlayModel {
|
||||
convenience init() {
|
||||
self.init(context: PersistenceController.shared.viewContext)
|
||||
}
|
||||
}
|
||||
|
||||
extension KSVideoPlayerView {
|
||||
init(url: URL) {
|
||||
let request = NSFetchRequest<MovieModel>(entityName: "MovieModel")
|
||||
request.predicate = NSPredicate(format: "url == %@", url.description)
|
||||
let model = (try? PersistenceController.shared.viewContext.fetch(request).first) ?? MovieModel(url: url)
|
||||
self.init(model: model)
|
||||
}
|
||||
|
||||
init(model: MovieModel) {
|
||||
let url = model.url!
|
||||
let options = MEOptions()
|
||||
#if DEBUG
|
||||
if url.lastPathComponent == "h264.mp4" {
|
||||
// options.videoFilters = ["hflip", "vflip"]
|
||||
// options.hardwareDecode = false
|
||||
options.startPlayTime = 13
|
||||
} else if url.lastPathComponent == "vr.mp4" {
|
||||
options.display = .vr
|
||||
} else if url.lastPathComponent == "mjpeg.flac" {
|
||||
// options.videoDisable = true
|
||||
options.syncDecodeAudio = true
|
||||
} else if url.lastPathComponent == "subrip.mkv" {
|
||||
options.asynchronousDecompression = false
|
||||
options.videoFilters.append("yadif_videotoolbox=mode=\(MEOptions.yadifMode):parity=-1:deint=1")
|
||||
} else if url.lastPathComponent == "big_buck_bunny.mp4" {
|
||||
options.startPlayTime = 25
|
||||
} else if url.lastPathComponent == "bipbopall.m3u8" {
|
||||
#if os(macOS)
|
||||
let moviesDirectory = try? FileManager.default.url(for: .moviesDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
|
||||
options.outputURL = moviesDirectory?.appendingPathComponent("recording.mov")
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
options.referer = model.httpReferer
|
||||
if let httpUserAgent = model.httpUserAgent {
|
||||
options.userAgent = httpUserAgent
|
||||
}
|
||||
let playmodel = model.getPlaymodel()
|
||||
playmodel.playTime = Date()
|
||||
if playmodel.duration > 0, playmodel.current > 0, playmodel.duration > playmodel.current + 120 {
|
||||
options.startPlayTime = TimeInterval(playmodel.current)
|
||||
}
|
||||
playmodel.save()
|
||||
model.save()
|
||||
self.init(url: url, options: options, title: model.name)
|
||||
}
|
||||
}
|
||||
88
KSPlayer-main/Demo/SwiftUI/Shared/Persistence.swift
Normal file
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// Persistence.swift
|
||||
// DataTest
|
||||
//
|
||||
// Created by kintan on 2023/7/2.
|
||||
//
|
||||
|
||||
import CloudKit
|
||||
import CoreData
|
||||
import KSPlayer
|
||||
|
||||
struct PersistenceController {
|
||||
static let shared = PersistenceController()
|
||||
|
||||
static var preview: PersistenceController = {
|
||||
let result = PersistenceController(inMemory: true)
|
||||
let viewContext = result.container.viewContext
|
||||
var urls: [String] = [
|
||||
"https://raw.githubusercontent.com/YanG-1989/m3u/main/Gather.m3u",
|
||||
"https://iptv-org.github.io/iptv/index.m3u",
|
||||
"https://iptv-org.github.io/iptv/countries/cn.m3u",
|
||||
"https://iptv-org.github.io/iptv/countries/hk.m3u",
|
||||
"https://iptv-org.github.io/iptv/countries/tw.m3u",
|
||||
"https://iptv-org.github.io/iptv/regions/amer.m3u",
|
||||
"https://iptv-org.github.io/iptv/regions/asia.m3u",
|
||||
"https://iptv-org.github.io/iptv/regions/eur.m3u",
|
||||
"https://iptv-org.github.io/iptv/categories/education.m3u",
|
||||
"https://iptv-org.github.io/iptv/categories/movies.m3u",
|
||||
"https://iptv-org.github.io/iptv/languages/zho.m3u",
|
||||
"https://iptv-org.github.io/iptv/languages/eng.m3u",
|
||||
"https://raw.githubusercontent.com/kingslay/TestVideo/main/test.m3u",
|
||||
"https://raw.githubusercontent.com/kingslay/TestVideo/main/TestVideo.m3u",
|
||||
"https://raw.githubusercontent.com/kingslay/bulaoge/main/bulaoge.m3u",
|
||||
]
|
||||
for str in urls {
|
||||
if let url = URL(string: str) {
|
||||
_ = M3UModel(context: viewContext, url: url)
|
||||
}
|
||||
}
|
||||
do {
|
||||
try viewContext.save()
|
||||
} catch {
|
||||
// Replace this implementation with code to handle the error appropriately.
|
||||
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
|
||||
let nsError = error as NSError
|
||||
fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
|
||||
}
|
||||
return result
|
||||
}()
|
||||
|
||||
let container: NSPersistentCloudKitContainer
|
||||
let viewContext: NSManagedObjectContext
|
||||
init(inMemory: Bool = false) {
|
||||
let modelName = "Model"
|
||||
// load Data Model
|
||||
guard let url = Bundle.main.url(forResource: modelName, withExtension: "momd"),
|
||||
let model = NSManagedObjectModel(contentsOf: url)
|
||||
else {
|
||||
fatalError("Can't get \(modelName).momd in Bundle")
|
||||
}
|
||||
container = NSPersistentCloudKitContainer(name: modelName, managedObjectModel: model)
|
||||
viewContext = container.viewContext
|
||||
if inMemory {
|
||||
container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null")
|
||||
}
|
||||
container.loadPersistentStores { storeDescription, error in
|
||||
if let error = error as NSError? {
|
||||
// Replace this implementation with code to handle the error appropriately.
|
||||
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
|
||||
|
||||
/*
|
||||
Typical reasons for an error here include:
|
||||
* The parent directory does not exist, cannot be created, or disallows writing.
|
||||
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
|
||||
* The device is out of space.
|
||||
* The store could not be migrated to the current model version.
|
||||
Check the error message to determine what the actual problem was.
|
||||
*/
|
||||
|
||||
KSLog("Unresolved error \(error), \(error.userInfo), store url \(String(describing: storeDescription.url))")
|
||||
// if let url = storeDescription.url {
|
||||
// try? persistentStoreCoordinator.destroyPersistentStore(at: url, type: .sqlite)
|
||||
// }
|
||||
}
|
||||
}
|
||||
container.viewContext.automaticallyMergesChangesFromParent = true
|
||||
}
|
||||
}
|
||||
205
KSPlayer-main/Demo/SwiftUI/Shared/SettingView.swift
Normal file
@@ -0,0 +1,205 @@
|
||||
//
|
||||
// SettingView.swift
|
||||
// TracyPlayer
|
||||
//
|
||||
// Created by kintan on 2023/6/21.
|
||||
//
|
||||
|
||||
import KSPlayer
|
||||
import SwiftUI
|
||||
|
||||
struct SettingView: View {
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List {
|
||||
NavigationLink(destination: SettingGeneralView()) {
|
||||
Label("General", systemImage: "switch.2")
|
||||
}
|
||||
NavigationLink(destination: SettingAudioView()) {
|
||||
Label("Audio", systemImage: "waveform")
|
||||
}
|
||||
NavigationLink(destination: SettingVideoView()) {
|
||||
Label("Video", systemImage: "play.rectangle.fill")
|
||||
}
|
||||
NavigationLink(destination: SettingSubtitleView()) {
|
||||
Label("Subtitle", systemImage: "captions.bubble")
|
||||
}
|
||||
NavigationLink(destination: SettingAdvancedView()) {
|
||||
Label("Advanced", systemImage: "gearshape.2.fill")
|
||||
}
|
||||
}
|
||||
}
|
||||
.preferredColorScheme(.dark)
|
||||
.background(Color.black)
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingGeneralView: View {
|
||||
@Default(\.showRecentPlayList)
|
||||
private var showRecentPlayList
|
||||
var body: some View {
|
||||
Form {
|
||||
Toggle("Show Recent Play List", isOn: $showRecentPlayList)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingAudioView: View {
|
||||
@Default(\.audioPlayerType)
|
||||
private var audioPlayerType
|
||||
init() {}
|
||||
var body: some View {
|
||||
Form {
|
||||
Picker("audio Player Type", selection: $audioPlayerType) {
|
||||
Text("AUGraph").tag(NSStringFromClass(AudioGraphPlayer.self))
|
||||
Text("AudioUnit").tag(NSStringFromClass(AudioUnitPlayer.self))
|
||||
Text("AVAudioEngine").tag(NSStringFromClass(AudioEnginePlayer.self))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingVideoView: View {
|
||||
@Default(\.hardwareDecode)
|
||||
private var hardwareDecode
|
||||
@Default(\.asynchronousDecompression)
|
||||
private var asynchronousDecompression
|
||||
@Default(\.isUseDisplayLayer)
|
||||
private var isUseDisplayLayer
|
||||
@Default(\.yadifMode)
|
||||
private var yadifMode
|
||||
var body: some View {
|
||||
Form {
|
||||
Toggle("Hardware decoder", isOn: $hardwareDecode)
|
||||
Toggle("Asynchronous Decompression", isOn: $asynchronousDecompression)
|
||||
Toggle("Use DisplayLayer", isOn: $isUseDisplayLayer)
|
||||
Picker("yadif Mode", selection: $yadifMode) {
|
||||
Text("yadif").tag(0)
|
||||
Text("yadif_2x").tag(1)
|
||||
Text("yadif_spatial_skip").tag(2)
|
||||
Text("yadif_2x_spatial_skip").tag(3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingSubtitleView: View {
|
||||
@Default(\.textFontSize)
|
||||
private var textFontSize
|
||||
@Default(\.textBold)
|
||||
private var textBold
|
||||
@Default(\.textItalic)
|
||||
private var textItalic
|
||||
@Default(\.textColor)
|
||||
private var textColor
|
||||
@Default(\.textBackgroundColor)
|
||||
private var textBackgroundColor
|
||||
@Default(\.verticalAlign)
|
||||
private var verticalAlign
|
||||
@Default(\.horizontalAlign)
|
||||
private var horizontalAlign
|
||||
@Default(\.leftMargin)
|
||||
private var leftMargin
|
||||
@Default(\.rightMargin)
|
||||
private var rightMargin
|
||||
@Default(\.verticalMargin)
|
||||
private var verticalMargin
|
||||
var body: some View {
|
||||
Form {
|
||||
Section("Position") {
|
||||
HStack {
|
||||
#if os(iOS)
|
||||
Text("Fone Size:")
|
||||
#endif
|
||||
TextField("Fone Size:", value: $textFontSize, format: .number)
|
||||
}
|
||||
Toggle("Bold", isOn: $textBold)
|
||||
Toggle("Italic", isOn: $textItalic)
|
||||
#if !os(tvOS)
|
||||
ColorPicker("Color:", selection: $textColor)
|
||||
ColorPicker("Background:", selection: $textBackgroundColor)
|
||||
#endif
|
||||
}
|
||||
Section("Position") {
|
||||
Picker("Align X:", selection: $horizontalAlign) {
|
||||
ForEach([HorizontalAlignment.leading, .center, .trailing]) { value in
|
||||
Text(value.rawValue).tag(value)
|
||||
}
|
||||
}
|
||||
Picker("Align Y:", selection: $verticalAlign) {
|
||||
ForEach([VerticalAlignment.top, .center, .bottom]) { value in
|
||||
Text(value.rawValue).tag(value)
|
||||
}
|
||||
}
|
||||
HStack {
|
||||
#if os(iOS)
|
||||
Text("Margin Left:")
|
||||
#endif
|
||||
TextField("Margin Left:", value: $leftMargin, format: .number)
|
||||
}
|
||||
HStack {
|
||||
#if os(iOS)
|
||||
Text("Margin Right:")
|
||||
#endif
|
||||
TextField("Margin Right:", value: $rightMargin, format: .number)
|
||||
}
|
||||
HStack {
|
||||
#if os(iOS)
|
||||
Text("Margin Vertical:")
|
||||
#endif
|
||||
TextField("Margin Vertical:", value: $verticalMargin, format: .number)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingAdvancedView: View {
|
||||
@Default(\.preferredForwardBufferDuration)
|
||||
private var preferredForwardBufferDuration
|
||||
@Default(\.maxBufferDuration)
|
||||
private var maxBufferDuration
|
||||
@Default(\.isLoopPlay)
|
||||
private var isLoopPlay
|
||||
@Default(\.canBackgroundPlay)
|
||||
private var canBackgroundPlay
|
||||
@Default(\.isAutoPlay)
|
||||
private var isAutoPlay
|
||||
@Default(\.isSecondOpen)
|
||||
private var isSecondOpen
|
||||
@Default(\.isAccurateSeek)
|
||||
private var isAccurateSeek
|
||||
@Default(\.isPipPopViewController)
|
||||
private var isPipPopViewController
|
||||
// @Default(\.isLoopPlay)
|
||||
// private var isLoopPlay
|
||||
var body: some View {
|
||||
Form {
|
||||
HStack {
|
||||
#if os(iOS)
|
||||
Text("Preferred Forward Buffer Duration:")
|
||||
#endif
|
||||
TextField("Preferred Forward Buffer Duration:", value: $preferredForwardBufferDuration, format: .number)
|
||||
}
|
||||
HStack {
|
||||
#if os(iOS)
|
||||
Text("Max Buffer Second:")
|
||||
#endif
|
||||
TextField("Max Buffer Second:", value: $maxBufferDuration, format: .number)
|
||||
}
|
||||
Toggle("Loop Play", isOn: $isLoopPlay)
|
||||
Toggle("Can Background Play", isOn: $canBackgroundPlay)
|
||||
Toggle("Auto Play", isOn: $isAutoPlay)
|
||||
Toggle("Fast Open Video", isOn: $isSecondOpen)
|
||||
Toggle("Fast Seek Video", isOn: $isAccurateSeek)
|
||||
Toggle("Picture In Picture Inline", isOn: $isPipPopViewController)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SettingView()
|
||||
}
|
||||
}
|
||||
253
KSPlayer-main/Demo/SwiftUI/Shared/TracyApp.swift
Normal file
@@ -0,0 +1,253 @@
|
||||
//
|
||||
// TracyApp.swift
|
||||
// Shared
|
||||
//
|
||||
// Created by kintan on 2021/5/3.
|
||||
//
|
||||
|
||||
import AVFoundation
|
||||
import AVKit
|
||||
import KSPlayer
|
||||
import SwiftUI
|
||||
import UserNotifications
|
||||
|
||||
@main
|
||||
struct TracyApp: App {
|
||||
#if os(macOS)
|
||||
@NSApplicationDelegateAdaptor
|
||||
#else
|
||||
@UIApplicationDelegateAdaptor
|
||||
#endif
|
||||
private var appDelegate: AppDelegate
|
||||
private let appModel = APPModel()
|
||||
init() {
|
||||
let arguments = ProcessInfo.processInfo.arguments.dropFirst()
|
||||
var dropNextArg = false
|
||||
var playerArgs = [String]()
|
||||
var filenames = [String]()
|
||||
KSLog("launch arguments \(arguments)")
|
||||
for argument in arguments {
|
||||
if dropNextArg {
|
||||
dropNextArg = false
|
||||
continue
|
||||
}
|
||||
if argument.starts(with: "--") {
|
||||
playerArgs.append(argument)
|
||||
} else if argument.starts(with: "-") {
|
||||
dropNextArg = true
|
||||
} else {
|
||||
filenames.append(argument)
|
||||
}
|
||||
}
|
||||
if let urlString = filenames.first {
|
||||
appModel.open(url: URL(fileURLWithPath: urlString))
|
||||
}
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
.environmentObject(appModel)
|
||||
.environment(\.managedObjectContext, PersistenceController.shared.viewContext)
|
||||
#if !os(tvOS)
|
||||
.handlesExternalEvents(preferring: Set(arrayLiteral: "pause"), allowing: Set(arrayLiteral: "*"))
|
||||
#endif
|
||||
}
|
||||
#if !os(tvOS)
|
||||
// .handlesExternalEvents(matching: Set(arrayLiteral: "*"))
|
||||
.commands {
|
||||
CommandGroup(before: .newItem) {
|
||||
Button("Open") {
|
||||
appModel.openFileImport = true
|
||||
}
|
||||
.keyboardShortcut("o")
|
||||
}
|
||||
CommandGroup(before: .newItem) {
|
||||
Button("Open URL") {
|
||||
appModel.openURLImport = true
|
||||
}
|
||||
.keyboardShortcut("o", modifiers: [.command, .shift])
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if os(macOS)
|
||||
.defaultSize(width: 1120, height: 630)
|
||||
.defaultPosition(.center)
|
||||
#endif
|
||||
#if !os(tvOS)
|
||||
WindowGroup("player", for: URL.self) { $url in
|
||||
if let url {
|
||||
KSVideoPlayerView(url: url)
|
||||
}
|
||||
}
|
||||
#if os(macOS)
|
||||
.defaultPosition(.center)
|
||||
#endif
|
||||
#endif
|
||||
#if !os(tvOS)
|
||||
WindowGroup("player", for: MovieModel.self) { $model in
|
||||
if let model {
|
||||
KSVideoPlayerView(model: model)
|
||||
}
|
||||
}
|
||||
#if os(macOS)
|
||||
.defaultPosition(.center)
|
||||
#endif
|
||||
#endif
|
||||
#if os(macOS)
|
||||
Settings {
|
||||
TabBarItem.Setting.destination(appModel: appModel)
|
||||
}
|
||||
// MenuBarExtra {
|
||||
// MenuBar()
|
||||
// } label: {
|
||||
// Image(systemName: "film.fill")
|
||||
// }
|
||||
// .menuBarExtraStyle(.menu)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
#if os(macOS)
|
||||
func applicationDidFinishLaunching(_: Notification) {
|
||||
// requestNotification()
|
||||
}
|
||||
#else
|
||||
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
|
||||
// requestNotification()
|
||||
true
|
||||
}
|
||||
#endif
|
||||
|
||||
func application(_: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
||||
let tokenString = deviceToken.reduce("") { $0 + String(format: "%02x", $1) }
|
||||
print("Device push notification token - \(tokenString)")
|
||||
}
|
||||
|
||||
func application(_: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
|
||||
print("Failed to register for remote notification. Error \(error)")
|
||||
}
|
||||
|
||||
private func requestNotification() {
|
||||
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { allowed, error in
|
||||
if allowed {
|
||||
// register for remote push notification
|
||||
DispatchQueue.main.async {
|
||||
UIApplication.shared.registerForRemoteNotifications()
|
||||
}
|
||||
print("Push notification allowed by user")
|
||||
} else {
|
||||
print("Error while requesting push notification permission. Error \(String(describing: error))")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class APPModel: ObservableObject {
|
||||
@Published
|
||||
var openURL: URL?
|
||||
@Published
|
||||
var openPlayModel: MovieModel?
|
||||
@Published
|
||||
var tabSelected: TabBarItem = .Home
|
||||
@Published
|
||||
var path = NavigationPath()
|
||||
@Published
|
||||
var openFileImport = false
|
||||
@Published
|
||||
var openURLImport = false
|
||||
@Published
|
||||
var hiddenTitleBar = false
|
||||
@AppStorage("activeM3UURL")
|
||||
private var activeM3UURL: URL?
|
||||
@Published
|
||||
var activeM3UModel: M3UModel? = nil {
|
||||
didSet {
|
||||
if let activeM3UModel, activeM3UModel != oldValue {
|
||||
activeM3UURL = activeM3UModel.m3uURL
|
||||
Task { @MainActor in
|
||||
_ = try? await activeM3UModel.parsePlaylist()
|
||||
// 为了解决第一次添加m3u。没有数据的问题,所以需要在查询结果出来之后,在设置下。
|
||||
if activeM3UModel == self.activeM3UModel {
|
||||
self.activeM3UModel = activeM3UModel
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init() {
|
||||
#if DEBUG
|
||||
// KSOptions.logLevel = .debug
|
||||
#else
|
||||
var fileHandle = FileHandle.standardOutput
|
||||
if let logURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first?.appendingPathComponent("log.txt") {
|
||||
if !FileManager.default.fileExists(atPath: logURL.path) {
|
||||
FileManager.default.createFile(atPath: logURL.path, contents: nil)
|
||||
}
|
||||
if let handle = try? FileHandle(forWritingTo: logURL) {
|
||||
fileHandle = handle
|
||||
_ = try? fileHandle.seekToEnd()
|
||||
}
|
||||
}
|
||||
KSOptions.logger = FileLog(fileHandle: fileHandle)
|
||||
#endif
|
||||
// KSOptions.firstPlayerType = KSMEPlayer.self
|
||||
KSOptions.secondPlayerType = KSMEPlayer.self
|
||||
_ = Defaults.shared
|
||||
KSOptions.subtitleDataSouces = [DirectorySubtitleDataSouce(), ShooterSubtitleDataSouce(), AssrtSubtitleDataSouce(token: "5IzWrb2J099vmA96ECQXwdRSe9xdoBUv"), OpenSubtitleDataSouce(apiKey: "0D0gt8nV6SFHVVejdxAMpvOT0wByfKE5")]
|
||||
if let activeM3UURL {
|
||||
addM3U(url: activeM3UURL)
|
||||
}
|
||||
}
|
||||
|
||||
func addM3U(url: URL, name: String? = nil) {
|
||||
let request = M3UModel.fetchRequest()
|
||||
request.predicate = NSPredicate(format: "m3uURL == %@", url.description)
|
||||
let context = PersistenceController.shared.viewContext
|
||||
context.perform {
|
||||
self.activeM3UModel = try? context.fetch(request).first ?? M3UModel(context: context, url: url, name: name)
|
||||
}
|
||||
}
|
||||
|
||||
func open(url: URL) {
|
||||
if url.isPlaylist {
|
||||
addM3U(url: url)
|
||||
} else {
|
||||
#if os(macOS)
|
||||
openURL = url
|
||||
#else
|
||||
path.append(url)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
func content(model: MovieModel) -> some View {
|
||||
#if os(macOS)
|
||||
Button {
|
||||
self.openPlayModel = model
|
||||
} label: {
|
||||
MoiveView(model: model)
|
||||
}
|
||||
.buttonStyle(.borderless)
|
||||
#else
|
||||
NavigationLink(value: model) {
|
||||
MoiveView(model: model)
|
||||
}
|
||||
#if targetEnvironment(macCatalyst)
|
||||
.buttonStyle(.borderless)
|
||||
#else
|
||||
.buttonStyle(.automatic)
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
struct KSVideoPlayerView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
.environmentObject(APPModel())
|
||||
.environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)
|
||||
}
|
||||
}
|
||||
81
KSPlayer-main/Demo/SwiftUI/Shared/URLImportView.swift
Normal file
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// URLImportView.swift
|
||||
// Demo
|
||||
//
|
||||
// Created by kintan on 2020/3/22.
|
||||
// Copyright © 2020 kintan. All rights reserved.
|
||||
//
|
||||
|
||||
import KSPlayer
|
||||
import SwiftUI
|
||||
|
||||
struct URLImportView: View {
|
||||
@EnvironmentObject private var appModel: APPModel
|
||||
@State private var username = ""
|
||||
@State private var password = ""
|
||||
@State private var playURL: String = ""
|
||||
@State private var rememberURL = false
|
||||
@AppStorage("historyURLs") private var historyURLs = [URL]()
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
var body: some View {
|
||||
Form {
|
||||
Section {
|
||||
TextField("URL:", text: $playURL)
|
||||
Toggle("Remember URL", isOn: $rememberURL)
|
||||
if !historyURLs.isEmpty {
|
||||
Picker("History URL", selection: $playURL) {
|
||||
Text("None").tag("")
|
||||
ForEach(historyURLs) {
|
||||
Text($0.description).tag($0.description)
|
||||
}
|
||||
}
|
||||
#if os(tvOS)
|
||||
.pickerStyle(.inline)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Section("HTTP Authentication") {
|
||||
TextField("Username:", text: $username)
|
||||
SecureField("Password:", text: $password)
|
||||
}
|
||||
Section {
|
||||
Button("Done") {
|
||||
dismiss()
|
||||
let urlString = playURL.trimmingCharacters(in: NSMutableCharacterSet.whitespacesAndNewlines)
|
||||
if !urlString.isEmpty, var components = URLComponents(string: urlString) {
|
||||
if !username.isEmpty {
|
||||
components.user = username
|
||||
}
|
||||
if !password.isEmpty {
|
||||
components.password = password
|
||||
}
|
||||
if let url = components.url {
|
||||
if rememberURL {
|
||||
if let index = historyURLs.firstIndex(of: url) {
|
||||
historyURLs.swapAt(index, historyURLs.startIndex)
|
||||
} else {
|
||||
historyURLs.insert(url, at: 0)
|
||||
}
|
||||
if historyURLs.count > 20 {
|
||||
historyURLs.removeLast()
|
||||
}
|
||||
}
|
||||
appModel.open(url: url)
|
||||
}
|
||||
}
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
#endif
|
||||
#if os(macOS) || targetEnvironment(macCatalyst)
|
||||
Button("Cancel") {
|
||||
dismiss()
|
||||
}
|
||||
.keyboardShortcut(.cancelAction)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||