mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 10:44:06 +00:00
switch mpv to mpvkit
This commit is contained in:
@@ -6,6 +6,7 @@ import Logging
|
||||
import MediaPlayer
|
||||
import Repeat
|
||||
import SwiftUI
|
||||
import MPVKit
|
||||
|
||||
final class MPVBackend: PlayerBackend {
|
||||
static var timeUpdateInterval = 0.5
|
||||
@@ -467,17 +468,6 @@ final class MPVBackend: PlayerBackend {
|
||||
startClientUpdates()
|
||||
onFileLoaded = nil
|
||||
|
||||
case MPV_EVENT_PAUSE:
|
||||
DispatchQueue.main.async { [weak self] in self?.handleEndOfFile() }
|
||||
isPlaying = false
|
||||
networkStateTimer.start()
|
||||
|
||||
case MPV_EVENT_UNPAUSE:
|
||||
isPlaying = true
|
||||
isLoadingVideo = false
|
||||
isSeeking = false
|
||||
networkStateTimer.start()
|
||||
|
||||
case MPV_EVENT_VIDEO_RECONFIG:
|
||||
model.updateAspectRatio()
|
||||
|
||||
|
@@ -2,6 +2,7 @@ import CoreMedia
|
||||
import Defaults
|
||||
import Foundation
|
||||
import Logging
|
||||
import MPVKit
|
||||
#if !os(macOS)
|
||||
import Siesta
|
||||
import UIKit
|
||||
@@ -72,8 +73,7 @@ final class MPVClient: ObservableObject {
|
||||
let api = UnsafeMutableRawPointer(mutating: (MPV_RENDER_API_TYPE_OPENGL as NSString).utf8String)
|
||||
var initParams = mpv_opengl_init_params(
|
||||
get_proc_address: getProcAddress,
|
||||
get_proc_address_ctx: nil,
|
||||
extra_exts: nil
|
||||
get_proc_address_ctx: nil
|
||||
)
|
||||
|
||||
queue = DispatchQueue(label: "mpv")
|
||||
|
Reference in New Issue
Block a user