mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
format ordering adapted
- MP4 contains av1 encoded video which is not hardware accelerated. - MP4 format removed from AVPlayer Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
parent
9a1f0d7aaa
commit
617af2cd20
@ -122,7 +122,7 @@ final class AVPlayerBackend: PlayerBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func canPlay(_ stream: Stream) -> Bool {
|
func canPlay(_ stream: Stream) -> Bool {
|
||||||
stream.kind == .hls || stream.kind == .stream || (stream.kind == .adaptive && stream.format == .mp4)
|
stream.kind == .hls || stream.kind == .stream
|
||||||
}
|
}
|
||||||
|
|
||||||
func playStream(
|
func playStream(
|
||||||
|
@ -684,7 +684,7 @@ final class PlayerModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// First, we need to create an array with supported formats.
|
// First, we need to create an array with supported formats.
|
||||||
let formatOrderPiP: [QualityProfile.Format] = [.hls, .stream, .mp4]
|
let formatOrderPiP: [QualityProfile.Format] = [.stream, .hls]
|
||||||
|
|
||||||
guard let video = currentVideo else { return }
|
guard let video = currentVideo else { return }
|
||||||
guard let stream = avPlayerBackend.bestPlayable(availableStreams, maxResolution: .hd720p30, formatOrder: formatOrderPiP) else { return }
|
guard let stream = avPlayerBackend.bestPlayable(availableStreams, maxResolution: .hd720p30, formatOrder: formatOrderPiP) else { return }
|
||||||
|
@ -7,10 +7,10 @@ struct QualityProfile: Hashable, Identifiable, Defaults.Serializable {
|
|||||||
|
|
||||||
enum Format: String, CaseIterable, Identifiable, Defaults.Serializable {
|
enum Format: String, CaseIterable, Identifiable, Defaults.Serializable {
|
||||||
case avc1
|
case avc1
|
||||||
case mp4
|
|
||||||
case stream
|
case stream
|
||||||
case av1
|
|
||||||
case webm
|
case webm
|
||||||
|
case mp4
|
||||||
|
case av1
|
||||||
case hls
|
case hls
|
||||||
|
|
||||||
var id: String {
|
var id: String {
|
||||||
@ -30,16 +30,16 @@ struct QualityProfile: Hashable, Identifiable, Defaults.Serializable {
|
|||||||
|
|
||||||
var streamFormat: Stream.Format? {
|
var streamFormat: Stream.Format? {
|
||||||
switch self {
|
switch self {
|
||||||
case .av1:
|
|
||||||
return .av1
|
|
||||||
case .mp4:
|
|
||||||
return .mp4
|
|
||||||
case .stream:
|
|
||||||
return nil
|
|
||||||
case .avc1:
|
case .avc1:
|
||||||
return .avc1
|
return .avc1
|
||||||
|
case .stream:
|
||||||
|
return nil
|
||||||
case .webm:
|
case .webm:
|
||||||
return .webm
|
return .webm
|
||||||
|
case .mp4:
|
||||||
|
return .mp4
|
||||||
|
case .av1:
|
||||||
|
return .av1
|
||||||
case .hls:
|
case .hls:
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,7 @@ struct QualityProfileForm: View {
|
|||||||
func isFormatDisabled(_ format: QualityProfile.Format) -> Bool {
|
func isFormatDisabled(_ format: QualityProfile.Format) -> Bool {
|
||||||
guard backend == .appleAVPlayer else { return false }
|
guard backend == .appleAVPlayer else { return false }
|
||||||
|
|
||||||
let avPlayerFormats = [.mp4, .stream, QualityProfile.Format.hls]
|
let avPlayerFormats = [.stream, QualityProfile.Format.hls]
|
||||||
|
|
||||||
return !avPlayerFormats.contains(format)
|
return !avPlayerFormats.contains(format)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user