flutter_vlc_player
flutter_vlc_player copied to clipboard
Duration and position not set on iOS 13
Hey,
On iOS, duration and position are not retrieved (I'm trying to play an external video file) then the lib throws an error
package:flutter/src/material/slider.dart': Failed assertion: line 174 pos 15: 'value >= min && value <= max': is not true.
Related to
Slider(
activeColor: Colors.red,
value: sliderValue,
min: 0.0,
max: _videoViewController.duration == null ? 1.0 : _videoViewController.duration.inSeconds.toDouble(),
onChanged: (progress) {
setState(() {
sliderValue = progress.floor().toDouble();
});
//convert to Milliseconds since VLC requires MS to set time
_videoViewController.setTime(sliderValue.toInt() * 1000);
},
)
It's working fine on Android
For testing purpose, I've added a sleep when initializing the file, the error is gone but the duration is still set to 0.0 so the progress bar is not updated
Same problem... It's very random, sometime works (1 time out of 20). And on iOS getDuration() is not referenced, and loop:true not work too.
I want to seekTo a position when OnInitListener. But the duration is zero when OnInitListener, then seekTo is not working due to :
if (position > value.duration) {
position = value.duration;
}