title: How to check remote broadcast and fix error with videoplayer chewie in Flutter?
body: <p>My English is not very good,
  I have prepared an application to watch TV broadcasts with IP, broadcasts are coming, there is no problem, I watch the broadcast, when I switch to another broadcast, it crashes on the broadcast that does not come.</p>
  <p>I want to check the incoming publication in the code written here, so that it does not give an error when the publication does not come, it returns to the main page or it can be written in the article as if this publication does not exist. Thanks</p>
  <pre><code>class ChewieVideo extends GetxController {
    final String videoData;
    ChewieVideo({required this.videoData});
  
    late VideoPlayerController videoPlayerController;
    ChewieController? chewieController;
  
    @override
    void onClose() {
      super.onClose();
      videoPlayerController.dispose();
      chewieController!.dispose();
    }
  
    @override
    void onInit() {
      super.onInit();
      initializePlayer();
    }
  
    Future&lt;void&gt; initializePlayer() async {
      videoPlayerController = VideoPlayerController.network(videoData);
  
      await Future.wait([videoPlayerController.initialize()]);
  
      chewieController = (ChewieController(
          videoPlayerController: videoPlayerController,
          autoPlay: true,
          looping: true,
          materialProgressColors: ChewieProgressColors(
            playedColor: Colors.red,
            handleColor: Colors.cyanAccent,
            backgroundColor: Colors.yellow,
            bufferedColor: Colors.lightGreen,
          ),
          placeholder: Container(
            color: Colors.white,
          ),
          autoInitialize: true,
          errorBuilder: (context, errorMessage) {
            return Center(
              child: Padding(
                padding: EdgeInsets.all(8.0),
                child: Text(
                  errorMessage,
                  style: TextStyle(color: white),
                ),
              ),
            );
          }));
      update();
    }
  }
  
  </code></pre>
  <pre><code>
  class VideoApp extends StatefulWidget {
    const VideoApp(
        {Key? key, required this.videoData, required this.channelLoading})
        : super(key: key);
    final String videoData;
    final String channelLoading;
  
    @override
    State&lt;VideoApp&gt; createState() =&gt; _VideoAppState();
  }
  
  class _VideoAppState extends State&lt;VideoApp&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Column(
          children: [
            GetBuilder&lt;ChewieVideo&gt;(
              init: ChewieVideo(videoData: widget.videoData),
              builder: (controller) =&gt; Expanded(
                child: Center(
                  child: controller.chewieController != null &amp;&amp;
                          controller.chewieController!.videoPlayerController.value
                              .isInitialized
                      ? Chewie(controller: controller.chewieController!)
                      : Column(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            CircularProgressIndicator(),
                            SizedBox(height: 10),
                            Text(
                              '${widget.channelLoading}=&gt; Yükleniyor',
                              style: TextStyle(fontSize: 20),
                            ),
                          ],
                        ),
                ),
              ),
            ),
          ],
        ),
      );
    }
  }
  
  </code></pre>