개빡쳐서 남기는 플러터 비디오 url로 받는 법

염지현·2024년 2월 26일

flutter

목록 보기
2/2
controller = VideoPlayerController.networkUrl(Uri.parse(baseUrl+videoUrl))
          ..initialize().then((_) {
            setState(() {});
          })..addListener(() {
            final error = controller.value.errorDescription;
            if (error != null) {
              print("Video player error: $error");
            }
          });
        controller.setPlaybackSpeed(1);
        played();

근데 안드로이드 보안상 url로 비디오 접근이 안되신단다... 그래서 androidmanifest.xml에 추가해줘야 함

android:networkSecurityConfig="@xml/network_security_config"
        android:usesCleartextTraffic="true"

이거 두개 application에 추가해야 됨

0개의 댓글