content: import 'package:find_seat/presentation/common_widgets/barrel_common_widgets.dart';
  import 'package:flutter/material.dart';
  import 'package:youtube_player_flutter/youtube_player_flutter.dart';
  
  class WidgetVideoPlayer extends StatefulWidget {
    String videoUrl;
  
    WidgetVideoPlayer({required this.videoUrl});
  
    @override
    _WidgetVideoPlayerState createState() => _WidgetVideoPlayerState();
  }
  
  class _WidgetVideoPlayerState extends State<WidgetVideoPlayer> {
    late YoutubePlayerController _controller;
  
    bool _isPlayerReady = false;
  
    @override
    void initState() {
      super.initState();
      _controller = YoutubePlayerController(
        initialVideoId: YoutubePlayer.convertUrlToId(widget.videoUrl)!,
        flags: YoutubePlayerFlags(
          mute: false,
          autoPlay: false,
          disableDragSeek: false,
          loop: false,
          isLive: false,
          forceHD: false,
          enableCaption: true,
        ),
      )..addListener(listener);
    }
  
    void listener() {
      if (_isPlayerReady && mounted && !_controller.value.isFullScreen) {
        //
      }
    }
  
    @override
    void deactivate() {
      // Pauses video while navigating to next page.
      _controller.pause();
      super.deactivate();
    }
  
    @override
    void dispose() {
      _controller.dispose();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return Stack(
        children: <Widget>[
          YoutubePlayer(
            controller: _controller,
            showVideoProgressIndicator: true,
            progressIndicatorColor: Colors.blueAccent,
            onReady: () {
              _isPlayerReady = true;
            },
          ),
          WidgetBtnBack(
            padding: const EdgeInsets.only(left: 20, top: 20),
          ),
        ],
      );
    }
  }
  