media-kit icon indicating copy to clipboard operation
media-kit copied to clipboard

memory leaks?

Open liuchuancong opened this issue 2 months ago • 5 comments

After playing the video for an hour in Windows, the content soared from 300MB to 1G. The non-caching attribute has been set. Is this a memory leak in the player?

Here is my simple code :

player = Player();
      if (player.platform is NativePlayer) {
        await (player.platform as dynamic).setProperty('cache', 'no');
      }
      mediaPlayerController = media_kit_video.VideoController(player);
      setDataSource(datasource);
      mediaPlayerController.player.stream.playing.listen((bool playing) {
        if (playing) {
          isPlaying.value = true;
        } else {
          isPlaying.value = false;
        }
      });
      mediaPlayerController.player.stream.error.listen((event) {
        if (event.toString().contains('Failed to open')) {
          hasError.value = true;
          isPlaying.value = false;
        }
      });
      mediaPlayerControllerInitialized.value = true;

liuchuancong avatar Apr 17 '24 04:04 liuchuancong