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>
This commit is contained in:
44
KSPlayer-main/Tests/KSPlayerTests/KSMEPlayerTest.swift
Normal file
44
KSPlayer-main/Tests/KSPlayerTests/KSMEPlayerTest.swift
Normal file
@@ -0,0 +1,44 @@
|
||||
@testable import KSPlayer
|
||||
import XCTest
|
||||
|
||||
class KSMEPlayerTest: XCTestCase {
|
||||
@MainActor
|
||||
func testPlaying() {
|
||||
if let path = Bundle(for: type(of: self)).path(forResource: "h264", ofType: "mp4") {
|
||||
let options = KSOptions()
|
||||
let player = KSMEPlayer(url: URL(fileURLWithPath: path), options: options)
|
||||
player.delegate = self
|
||||
XCTAssertEqual(player.isPlaying, false)
|
||||
player.play()
|
||||
XCTAssertEqual(player.isPlaying, true)
|
||||
player.pause()
|
||||
XCTAssertEqual(player.isPlaying, false)
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func testAutoPlay() {
|
||||
if let path = Bundle(for: type(of: self)).path(forResource: "h264", ofType: "mp4") {
|
||||
let options = KSOptions()
|
||||
let player = KSMEPlayer(url: URL(fileURLWithPath: path), options: options)
|
||||
player.delegate = self
|
||||
XCTAssertEqual(player.isPlaying, false)
|
||||
player.play()
|
||||
XCTAssertEqual(player.isPlaying, true)
|
||||
player.pause()
|
||||
XCTAssertEqual(player.isPlaying, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension KSMEPlayerTest: MediaPlayerDelegate {
|
||||
func readyToPlay(player _: some KSPlayer.MediaPlayerProtocol) {}
|
||||
|
||||
func changeLoadState(player _: some KSPlayer.MediaPlayerProtocol) {}
|
||||
|
||||
func changeBuffering(player _: some KSPlayer.MediaPlayerProtocol, progress _: Int) {}
|
||||
|
||||
func playBack(player _: some KSPlayer.MediaPlayerProtocol, loopCount _: Int) {}
|
||||
|
||||
func finish(player _: some KSPlayer.MediaPlayerProtocol, error _: Error?) {}
|
||||
}
|
||||
Reference in New Issue
Block a user