Closed skrew closed 10 months ago
音频和视频可以通过这个来选择,
/// wanted video stream index, or nil for automatic selection
/// - Parameter : video bitRate
/// - Returns: The index of the bitRates
open func wantedVideo(bitRates _: [Int64]) -> Int? {
nil
}
/// wanted audio stream index, or nil for automatic selection
/// - Parameter : audio bitRate and language
/// - Returns: The index of the infos
open func wantedAudio(infos _: [(bitRate: Int64, language: String?)]) -> Int? {
nil
}
字幕的话,你可以在 player(layer: KSPlayerLayer, state: KSPlayerState) 这个方法进行选择
@kingslay how to switch video track to auto while video is playing in (swiftUI)
Is your feature request related to a problem? Please describe.
User can select a track (eg, audio track) and want to have it selected immediately when playing the same file again. Setting the selected tracks after file loading make a freeze because the track are changed 1,2 or 3 times (for audio, sub or video).
Describe the solution you'd like
Like MEOoptions.startPlayTime, an option the set the wanted track number at start, instead of default one. As the file can change over the time, you have to check if the track exists before forcing it (to avoid crashs)