flutter_vlc_player icon indicating copy to clipboard operation
flutter_vlc_player copied to clipboard

Duration and position not set on iOS 13

Open eliysha opened this issue 5 years ago • 2 comments

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

eliysha avatar Nov 08 '20 01:11 eliysha

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.

MapleNoise avatar Dec 17 '20 10:12 MapleNoise

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;
 }

DamonChen117 avatar Aug 11 '21 03:08 DamonChen117