Flutter VLC Player는 VLC 미디어 플레이어 엔진을 기반으로 한 비디오 재생 솔루션으로, Flutter의 기본 video_player에 비해 향상된 호환성과 성능을 제공합니다. 하나의 화면에서 여러 비디오 플레이어를 지원하여 복잡한 비디오 레이아웃에 적합합니다. 안드로이드와 iOS용으로 설계되어 VLC의 강력한 디코딩 기능을 활용해 다양한 형식과 스트리밍 프로토콜을 처리할 수 있습니다. 개발자가 Flutter 애플리케이션에서 고급 비디오 기능이 필요할 때 신뢰할 수 있는 대안을 제공합니다.
사용 사례
지원되지 않는 코덱으로 비디오 재생
동시에 여러 비디오 표시
RTSP 또는 HLS 소스에서 스트리밍
비디오가 풍부한 대시보드 구축
비디오 편집 미리보기 만들기
주요 기능
VLC 엔진 통합
여러 플레이어 인스턴스
RTSP, HLS 및 DASH 지원
하드웨어 가속
사용자 정의 가능한 컨트롤
크로스 플랫폼(안드로이드 및 iOS)
적합한 대상
미디어 집약형 앱
라이브 영상 모니터링
비디오 회의 인터페이스
다양한 미디어 콘텐츠를 갖춘 교육 플랫폼
광범위한 형식 지원이 필요한 응용 프로그램
고려 사항
VLC 라이브러리로 인한 더 큰 앱 크기
많은 플레이어와 함께 가능한 메모리 사용량
일부 기능은 플랫폼별 설정이 필요합니다
주류 패키지에 비해 문서가 제한적
네트워크 스트림을 위해 추가 권한이 필요할 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Flutter VLC Player Plugin
A VLC-powered alternative to Flutter's video_player that supports iOS and Android.
Installation
iOS
If you're unable to view media loaded from an external source, you should also add the following:
For more information, or for more granular control over your App Transport Security (ATS) restrictions, you should
read Apple's documentation.
Make sure that following line in <project root>/ios/Podfile uncommented:
platform :ios, '9.0'
NOTE: While the Flutter video_player is not functional on iOS Simulators, this package (flutter_vlc_player) is
fully functional on iOS simulators.
To enable vlc cast functionality for external displays (chromecast), you should also add the following:
<key>NSLocalNetworkUsageDescription</key><string>Used to search for chromecast devices</string><key>NSBonjourServices</key><array><string>_googlecast._tcp</string></array>
Android
To load media/subitle from an internet source, your app will need the INTERNET permission.
This is done by ensuring your <project root>/android/app/src/main/AndroidManifest.xml file contains a uses-permission
declaration for android.permission.INTERNET:
As Flutter includes this permission by default, the permission is likely already declared in the file.
Note that if you got "Cleartext HTTP traffic to * is not permitted"
you need to add the android:usesClearTextTraffic="true" flag in the AndroidManifest.xml file, or define a new "Network Security Configuration" file. For more information, check https://developer.android.com/training/articles/security-config
In order to load media/subtitle from internal device storage, you should put the storage permissions as follows:
In some cases you also need to add the android:requestLegacyExternalStorage="true" flag to the Application tag in AndroidManifest.xml file to avoid acess denied errors. Android 10 apps can't acess storage without that flag. reference
After that you can access the media/subtitle file by
android {
packagingOptions {
// Fixes duplicate libraries build issue,
// when your project uses more than one plugin that depend on C++ libs.
pickFirst 'lib/**/libc++_shared.so'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
}
Create android/app/proguard-rules.pro, add the following lines:
-keep class org.videolan.libvlc.** { *; }
Quick Start
To start using the plugin, copy this code or follow the example project in 'flutter_vlc_player/example'
To start/stop video recording, you have to call the startRecording(String saveDirectory) and stopRecording() methods, respectively. By calling the stop method you can get the path of recorded file from vlcPlayerController.value.recordPath.
Upgrade instructions
Version 5.0 Upgrade For Existing Apps
To upgrade to version 5.0 first you need to migrate the existing project to swift.
Clean the repo:
git clean -xdf
Delete existing ios folder from root of flutter project. If you have some custom changes made to the iOS app - rename it or copy somewhere outside the project.
Re-create the iOS app: This command will create only ios directory with swift support. See https://stackoverflow.com/questions/52244346/how-to-enable-swift-support-for-existing-project-in-flutter
flutter create -i swift .
Make sure to update the project according to warnings shown by the flutter tools. (Update Info.plist, Podfile).
If you have some changes made to the iOS app, recreate the app using above method and copy in the changed files.
Be sure to follow instructions above after
Breaking Changes (from V4 to V5)
Entire platform has been refactored in v5. It will require a refactor of your app to follow v5.
Known Issues
1) The video recording feature is problematic in iOS/Android: if the video reaches its end while you're recording it, the underlying vlckit/libvlc library fails to finalize the recording process, and we cannot retrieve the recorded file.
The issue is reported and tracked here:
https://code.videolan.org/videolan/VLCKit/-/issues/394 (see last comment from September 22, 2020)