You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello sir. I have implemented a collection view. In each cell i have this code from your example. When i scroll to each cell i load a url in the VideoPlayer. For some reason sometimes the case .playing(let totalDuration): is not called so i can not show the progress bar at my project because i do not have the totalDuration. Although is not triggered the video starts playing. The only way i found to show the progress bar is to pause the video and then play it after it starts playing to trigger the .playing(let totalDuration) and show the progress bar.
Do you have any clue why this might be happening or any idea how to overcome this issue in SwiftUI?
Is it an issue in the GSPlayer you think?
Any help appreciated sir.
struct ContentView : View { @State private var autoReplay: Bool = true @State private var mute: Bool = false @State private var play: Bool = true @State private var time: CMTime = .zero
var body: some View {
VideoPlayer(url: someVideoURL, play: $play, time: $time)
.autoReplay(autoReplay)
.mute(mute)
.onBufferChanged { progress in
// Network loading buffer progress changed
}
.onPlayToEndTime {
// Play to the end time.
}
.onReplay {
// Replay after playing to the end.
}
.onStateChanged { state in
switch state {
case .loading:
// Loading...
case .playing(let totalDuration):
// Playing...
case .paused(let playProgress, let bufferProgress):
// Paused...
case .error(let error):
// Error...
}
}
}
}
The text was updated successfully, but these errors were encountered:
Hello sir. I have implemented a collection view. In each cell i have this code from your example. When i scroll to each cell i load a url in the VideoPlayer. For some reason sometimes the case .playing(let totalDuration): is not called so i can not show the progress bar at my project because i do not have the totalDuration. Although is not triggered the video starts playing. The only way i found to show the progress bar is to pause the video and then play it after it starts playing to trigger the .playing(let totalDuration) and show the progress bar.
Do you have any clue why this might be happening or any idea how to overcome this issue in SwiftUI?
Is it an issue in the GSPlayer you think?
Any help appreciated sir.
struct ContentView : View {
@State private var autoReplay: Bool = true
@State private var mute: Bool = false
@State private var play: Bool = true
@State private var time: CMTime = .zero
}
The text was updated successfully, but these errors were encountered: