mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
Fixed issue for IOS and android
This commit is contained in:
@@ -5,7 +5,9 @@ public class VlcPlayerModule: Module {
|
||||
Name("VlcPlayer")
|
||||
View(VlcPlayerView.self) {
|
||||
Prop("source") { (view: VlcPlayerView, source: [String: Any]) in
|
||||
view.setSource(source)
|
||||
if !view.hasSource {
|
||||
view.setSource(source)
|
||||
}
|
||||
}
|
||||
|
||||
Prop("paused") { (view: VlcPlayerView, paused: Bool) in
|
||||
|
||||
@@ -16,6 +16,7 @@ class VlcPlayerView: ExpoView {
|
||||
private var externalTrack: [String: String]?
|
||||
private var progressTimer: DispatchSourceTimer?
|
||||
private var isStopping: Bool = false // Define isStopping here
|
||||
var hasSource = false
|
||||
|
||||
// MARK: - Initialization
|
||||
|
||||
@@ -157,6 +158,7 @@ class VlcPlayerView: ExpoView {
|
||||
self.setSubtitleTrack(subtitleTrackIndex)
|
||||
|
||||
self.mediaPlayer?.media = media
|
||||
hasSource = true
|
||||
|
||||
if autoplay {
|
||||
print("Playing...")
|
||||
@@ -280,15 +282,11 @@ class VlcPlayerView: ExpoView {
|
||||
// MARK: - Private Methods
|
||||
|
||||
@objc private func applicationWillResignActive() {
|
||||
if !isPaused {
|
||||
pause()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@objc private func applicationDidBecomeActive() {
|
||||
if !isPaused {
|
||||
play()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private func performStop(completion: (() -> Void)? = nil) {
|
||||
|
||||
Reference in New Issue
Block a user