video_player close connection after 1 minute

This issue has been created since 2022-09-23.

Hi
I initialize video player for stream live video. everything is ok but when I back from player screen and check active connection on the server, my connection still open and close after 20~60 second. how to to fix it?

Code sample
void _initializeAndPlay(String link) async {
    print("_initializeAndPlay ---------> $link");

    final controller = VideoPlayerController.network(link);

    VideoPlayerController? old = _controller;
    _controller = controller;
    if (old != null) {
      old.pause();
      debugPrint("---- old contoller paused.");
    }

    debugPrint("---- controller changed.");
    setState(() {});

    controller..initialize().then((_) {
        debugPrint("---- controller initialized");
        old?.dispose();
        old = null;
        controller.play();
        setState(() {});
      });
  }

  @override
  void initState() {
    Wakelock.enable();
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);

    final clip = _channelModel.qualities[0].channel_category;
    selectedQuality = _channelModel.qualities[0];
    _initializeAndPlay(clip.link);

    initVolumeAndBrightnessState();

    super.initState();
  }

  @override
  void dispose() async{
    super.dispose();
    _disposed = true;
    _timerVisibleControl?.cancel();
    Wakelock.disable();
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
    _exitFullScreen();
    _controller?.removeListener(() { });
    await _controller?.pause(); // mute instantly
    await _controller?.dispose();
    _controller = null;
  }
exaby73 wrote this answer on 2022-09-23

Hi @iranandroid
This issue doesn't seem to describe a bug or a feature request. Please see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you

More Details About Repo
Owner Name flutter
Repo Name flutter
Full Name flutter/flutter
Language Dart
Created Date 2015-03-06
Updated Date 2022-10-05
Star Count 145512
Watcher Count 3569
Fork Count 23398
Issue Count 11205

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
oracledb install issue 4 2021-09-04 2022-10-05
Multilingual Detection Model convert Fail 0 2022-09-15 2022-09-22
Plugin fails to load in a new Obsidian installation 3 2022-02-27 2022-09-15
About dataset preprocessing: how to match the original videos with annots.npz in mpi_inf_3dhp 8 2021-12-24 2022-09-28
Add support for jwks_uri client secret 0 2022-02-18 2022-08-05
dir(grb) raises RunTimeError 3 2022-01-03 2022-07-13
Async loading .obj/.stl file thread issues 1 2022-03-08 2022-09-05
input enum how to support int value 9 2022-07-27 2022-10-01
Request to get Community solution for Exercise 'ex_1' in '2-Intelligent-Agent' 1 2022-06-21 2022-10-02
Request to get Community solution for Exercise 'ex_2' in '3-Solving-Problems-By-Searching' 0 2022-06-21 2022-10-01
Request to get Community solution for Exercise 'ex_19' in '17-Making-Complex-Decision' 0 2022-06-22 2022-10-01
`fillna = False` of ATR not work? 0 2022-03-13 2022-09-02
Basic Temperature Regulation 1 2022-01-08 2022-09-25
fluent.Reflect does not recognize go-cid.Cid 5 2021-08-02 2022-09-27
'nmap program was not found in path' 1 2021-03-29 2022-09-30
How to configure retention policy for daily partitions? 3 2021-10-05 2022-08-15
Library hangs with default compression 7 2021-09-18 2022-09-06
Update of installed adapters does not work if the host is changed 2 2021-12-18 2022-09-13
Adding support to create composite test keeper for any custom module in testutil directory 0 2022-04-01 2022-09-27
[BUG] method fill_missing_values changes columns name 3 2021-08-05 2022-09-28
Feature Request: 从 QQ 转发到 TG 的时候,图片会自己没了 3 2022-02-11 2022-08-22
a new attachment window appears out of focus 5 2022-02-02 2022-09-30
Keybase client has worked on Fedora 34 but stopped working on Fedora 35 10 2021-10-25 2022-09-19
Fix push rejected in documentation deploy 0 2021-06-30 2022-08-06
[BUG] Cache states of dataset is not right when using Juicefs enterprise 0 2022-05-09 2022-06-11
[containers] explore vaccel-based firecracker accelerator virtualization 2 2022-02-21 2022-09-04
[Bug] `TimeoutError` with empty train function 1 2022-02-21 2022-08-12
How to simulate TLS 1.0 vulnerability breach on Azure storage account? 1 2022-08-22 2022-08-27
匿名函数的 this 指向了真实 window, 而不是 proxy 0 2022-04-20 2022-07-16
[BUG] The id of a recurring job can only contain letters and numbers when not specifying an Id and using Spring Transactions 2 2021-06-02 2022-09-15
[FR] Currently unable to specify variant names when deploying models to Sagemaker 4 2022-07-01 2022-08-28
Tracking Server not working as a proxy for localhost 68 2022-07-01 2022-08-10
[FR] Rollback to Previous Model Version in Stage 16 2022-07-01 2022-08-26
[BUG] INVALID_PARAMETER_VALUE for parameter 'params' 2 2022-07-01 2022-09-26
[BUG] mlflow deployments cli predict help menu broken 3 2022-06-30 2022-07-28
Stackframe paths to Stdlib files incorrect 3 2022-05-12 2022-08-19
[develop2][bug] CMakeToolchain preprocessor_definitions type lost 2 2022-08-31 2022-09-02
[Bug]: Custom tabs have dark icons when no tabs open in firefox 1 2022-05-26 2022-09-05
cgen error: json.encode fails on type alias 0 2022-08-21 2022-08-27
having trouble re-creating npm build 3 2022-04-08 2022-09-27
scheme it's just have http scheme there is no https shema 0 2021-06-29 2022-08-12
App_run command metasploit android meterpreter reverse_tcp 3 2022-01-08 2022-09-28
Library does not build with MSVC+x86 0 2021-09-16 2022-10-02
4030 on HLS Manifest 3 2021-11-07 2022-10-02
How to merge only video stream of a format 4 2022-03-25 2022-10-02
Feature Request: --subheading-pattern 1 2022-04-16 2022-09-29
Cannot run bpf program with capabilities CAP_BPF, CAP_SYS_ADMIN enabled. 8 2022-07-15 2022-09-23
Error on Windows power shell - claat : The term 'claat' is not recognized as the name of a cmdlet, function, script file, or operable program. 1 2021-04-13 2022-10-01
ESP32 port need a "make clean" to freeze custom py module 3 2021-09-07 2022-09-29
x86_64-conda_cos6-linux-gnu-cc' failed with exit status 1 0 2021-02-22 2022-09-07