flutter-meedu-player icon indicating copy to clipboard operation
flutter-meedu-player copied to clipboard

error in progress slider

Open CarmenLexa opened this issue 4 years ago • 1 comments

Hi I am using the player with autoplay and fullscreen everything works fine, but when the player is restored it goes out of fullscreen, the progress slider stops working and the events

onPositionChanged onSliderPositionChanged

They stop working, this is my code

final MeeduPlayerController _controller_video = MeeduPlayerController( controlsStyle: ControlsStyle.primary );

body: ListView( shrinkWrap: true, children: [ AspectRatio( aspectRatio: 15 / 9, child: MeeduVideoPlayer( controller: _controller_video, header: (ctx, controller, responsive) { // creates a responsive fontSize using the size of video container final double fontSize = responsive.ip(3); return Container( padding: EdgeInsets.only(left: 10), color: Colors.black12, child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text("${this.movie.title}", style: TextStyle( color: Colors.white, fontSize: fontSize > 17 ? 17 : fontSize, ), ), ], ), ); }, ) )

    ],
  )

if (_dataSource == null) {

    _dataSource = DataSource(
      source: source,
      type: DataSourceType.network,
    );

    await this._controller_video.launchAsFullscreen(
      context,
      dataSource: _dataSource,
      autoplay: true,
    );


}else{

    await this._controller_video.setDataSource(
        _dataSource.copyWith(
          source: source,
        ),
        seekTo: Duration.zero,
    );

}

everything seems to be correct, but when exiting fullscreen the slider freezes

CarmenLexa avatar Nov 10 '20 14:11 CarmenLexa

launchAsFullscreen

@CarmenLexa the launchAsFullscreen method creates its own MeeduVideoPlayer and not use the video player defined in your body for that reason if you want to use launchAsFullscreen and have a MeeduVideoPlayer in the same page you must have one controller for each player or if you have a player in your page and you just want got to fullscreen using code in that case you must use the goToFullscreen(context) method

darwin-morocho avatar Nov 16 '20 16:11 darwin-morocho