KomodioPlayerView
struct KomodioPlayerView : View
SwiftUI View
for a video player (shared)
Currently, Komodio is using the AVPlayer
from the SwiftlyKodiAPI package
It can only play ‘Apple Approved’ formats, so no MKV‘s
It is my intension to replace this sooner or later, but for now, it is as it is.
It will give a warning if it can’t play the file
-
The media item
Declaration
Swift
let media: MediaItem
-
The Video item try want to play
Declaration
Swift
@State private var video: (any KodiItem)? { get nonmutating set }
-
The loading state of the View
Declaration
Swift
@State private var status: ViewStatus { get nonmutating set }
-
-
-
-
The body of the
View
Declaration
Swift
var body: some View { get }
-
checkMedia()
AsynchronousCheck if we can play the media
Declaration
Swift
func checkMedia() async -> ViewStatus
Return Value
The status
-
SwiftUI
See moreView
for message that we can’t play a videoDeclaration
Swift
struct CantPlay : View
-
Check if we can play a video or not
Declaration
Swift
static func canPlay(video: any KodiItem) -> Bool
Parameters
video
The video item
Return Value
True or False