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
ViewDeclaration
Swift
var body: some View { get } -
checkMedia()AsynchronousCheck if we can play the media
Declaration
Swift
func checkMedia() async -> ViewStatusReturn Value
The status
-
SwiftUI
See moreViewfor 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) -> BoolParameters
videoThe video item
Return Value
True or False
View on GitHub
KomodioPlayerView Structure Reference