Skip to content

Commit

Permalink
Merge pull request #676 from nazar-41/develop
Browse files Browse the repository at this point in the history
[FEATURE]: added functionality to select the default video track from MediaPlayerTrack
  • Loading branch information
kingslay authored Nov 29, 2023
2 parents cc60322 + bbb22c8 commit 17f87e4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
14 changes: 14 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "ffmpegkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kingslay/FFmpegKit.git",
"state" : {
"revision" : "ce7d13b161ad527417cfda9f00eaad2f8f7f9330",
"version" : "6.1.0"
}
}
],
"version" : 2
}
3 changes: 1 addition & 2 deletions Sources/KSPlayer/AVPlayer/KSOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,9 @@ open class KSOptions {
/// wanted video stream index, or nil for automatic selection
/// - Parameter : video bitRate
/// - Returns: The index of the bitRates
open func wantedVideo(bitRates _: [Int64]) -> Int? {
open func wantedVideo(tracks _: [MediaPlayerTrack]) -> Int?{
nil
}

/// wanted audio stream index, or nil for automatic selection
/// - Parameter : audio bitRate and language
/// - Returns: The index of the infos
Expand Down
2 changes: 1 addition & 1 deletion Sources/KSPlayer/MEPlayer/MEPlayerItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ extension MEPlayerItem {
$0 > 0
}
let wantedStreamNb: Int32
if !videos.isEmpty, let index = options.wantedVideo(bitRates: bitRates) {
if !videos.isEmpty, let index = options.wantedVideo(tracks: videos) {
wantedStreamNb = videos[index].trackID
} else {
wantedStreamNb = -1
Expand Down

0 comments on commit 17f87e4

Please sign in to comment.