mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-11-04 10:13:59 +00:00
AVPlayer misreads the duration of some fragmented MP4 streams (it reports double the real length, leaving the second half silent and never ending the track). Playback on iOS now goes through VLCKit 4, added as a Swift package pinned to videolan/vlckit@6b87735. - NativePlayerEngine (iosMain): single-media engine contract that Swift implements and registers at launch; VLCKit ships as an SPM binary target, so it can't be bound with cinterop from Gradle. - AudioPlayer.ios.kt: rewritten on the engine. Playlist, loop modes, shuffle and auto-advance live in Kotlin, mirroring the JVM player (the old iOS player never advanced to the next track). - VlcPlayerEngine.swift: VLCKit-backed engine. VLCKit 4 has no "ended" state, so natural ends are told apart from requested stops; after a pause/resume it stops reporting time, so a no-op seek restores position updates.
33 lines
1.1 KiB
Swift
33 lines
1.1 KiB
Swift
// Copyright (C) 2026 Kingkor Roy Tirtho and Spotube Contributors
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Affero General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
import SwiftUI
|
|
import ComposeApp
|
|
|
|
@main
|
|
struct iOSApp: App {
|
|
init() {
|
|
registerNativePlayerEngine()
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
ContentView()
|
|
.onOpenURL { url in
|
|
ExternalUriHandler.shared.onNewUri(uri: url.absoluteString)
|
|
}
|
|
}
|
|
}
|
|
} |