import 'package:flutter/material.dart';
import 'package:gz_video_player/video_progress_style.dart';
import 'package:video_player/video_player.dart';

class VideoDefaultProgressBar extends StatelessWidget {
  final VideoPlayerController controller;
  final bool allowScrubbing;
  final VideoProgressStyle progressStyle;

  VideoDefaultProgressBar({
    super.key,
    required this.controller,
    this.allowScrubbing = true,
    VideoProgressStyle? progressStyle,
  }) : progressStyle = progressStyle ?? VideoProgressStyle();

  @override
  Widget build(BuildContext context) {
    return VideoProgressIndicator(
      controller,
      allowScrubbing: allowScrubbing,
      colors: VideoProgressColors(
        playedColor: progressStyle.playedColor,
        bufferedColor: progressStyle.bufferedColor,
        backgroundColor: progressStyle.backgroundColor,
      ),
      padding: progressStyle.padding,
    );
  }
}
