Skip to content

Commit

Permalink
fixed playerItem when handling hls streams from remote method
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeichhorn committed Oct 19, 2024
1 parent 499e030 commit ae7d9ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/YouTubeKit/YouTube+PlayerItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension YouTube {

let composition = AVMutableComposition()

guard let videoStream = streams.filter({ $0.isNativelyPlayable }).filterVideoOnly().filter(byResolution: { ($0 ?? .max) <= (maxResolution ?? .max) }).highestResolutionStream(),
guard let videoStream = streams.filter({ $0.isNativelyPlayable && $0.url.pathExtension != "m3u8" }).filterVideoOnly().filter(byResolution: { ($0 ?? .max) <= (maxResolution ?? .max) }).highestResolutionStream(),
let audioStream = streams.filter({ $0.isNativelyPlayable }).filterAudioOnly().highestAudioBitrateStream() else {
throw YouTubeKitError.extractError
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/YouTubeKitTests/PlayabilityTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ final class PlayabilityTests: XCTestCase {

func testAutoCombinedPlayerItemPlayability() async throws {

let videoID = "njX2bu-_Vw4"
let videoID = "Slj4-Sv-YNA"
let youtubeLocal = YouTube(videoID: videoID, methods: [.local])
let youtubeRemote = YouTube(videoID: videoID, methods: [.remote])

Expand Down

0 comments on commit ae7d9ef

Please sign in to comment.