feat: support start time

This commit is contained in:
Fredrik Burmester
2024-10-16 08:21:42 +02:00
parent 951a9d08ba
commit fcffee1981
3 changed files with 10 additions and 0 deletions

View File

@@ -97,6 +97,7 @@ class VlcPlayerView: ExpoView {
let initType = source["initType"] as? Int ?? 0
let autoplay = source["autoplay"] as? Bool ?? false
let isNetwork = source["isNetwork"] as? Bool ?? false
let startPosition = source["startPosition"] as? Int32 ?? 0
guard let uri = uri, !uri.isEmpty else { return }
@@ -152,6 +153,10 @@ class VlcPlayerView: ExpoView {
self.mediaPlayer?.media = media
if startPosition > 0 {
self.mediaPlayer?.time = VLCTime(int: startPosition)
}
if autoplay {
self.play()
}