initPlayer method
Implementation
initPlayer(FlutterFlexPlayerController controller) {
_controller = controller;
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 200),
);
_playPauseController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 200),
);
_playerStateSubscription = _controller.onPlayerStateChanged.listen((state) {
if (state == PlayerState.playing) {
_playPauseController.reverse();
} else {
_playPauseController.forward();
}
});
_playPauseController.forward();
_animationController.forward();
if (_controller.isPlaying) {
_playPauseController.reverse();
}
startTimer();
}