live_file_publisher
所属分类:视频会议
开发工具:Dart
文件大小:0KB
下载次数:0
上传日期:2024-02-24 23:05:17
上 传 者:
sh-1993
说明: 这是一个颤振包,用于将文件发布到RTSP或RTMP服务器。
(This is a flutter package to publish file to RTSP or RTMP server.)
文件列表:
lib/
test/
.flutter-plugins
.flutter-plugins-dependencies
.metadata
CHANGELOG.md
LICENSE
analysis_options.yaml
pubspec.yaml
# Introduction
live_file_publisher is a Flutter package that enables you to seamlessly publish your video file to RTSP or RTMP servers within your Flutter applications.
## Features
- Publish live video streams to RTSP or RTMP servers.
- Easy integration into your Flutter applications.
## Installation
```
flutter pub add live_file_publisher
```
## Usage
```dart
// import the package
import 'package:live_file_publisher/live_file_publisher.dart';
// Initialise
LiveFilePublisher filePublisher = LiveFilePublisher();
// Event callback
@override
void initState() {
super.initState();
filePublisher.addStateListener(onStateListener);
filePublisher.addErrorListener(onErrorListener);
filePublisher.addLogListener(onLogListener);
}
void onStateListener(PublishingState state) {
print(state);
}
void onErrorListener(Object error) {
print(error);
}
void onLogListener(String log) {
print(log)
}
.
.
// Connect
filePublisher.connect(url: 'rtsp://localhost', mode: PublisherProtocol.RTSP_UDP);
// Publish
filePublisher.publish(startTime: '00:00:00',filePath: ,name: 'mystream');
.
.
// Stop
filePublisher.stop();
```
### Enums
```dart
enum PublisherProtocol {
RTMP,
RTSP_UDP,
RTSP_TCP,
}
enum PublishingState {
Normal,
RequestPublish,
Publishing,
RequestStopPublish,
}
```
### Known issues
There are some issues publishing iphone video which are in HEVC format. They need to be transcoded using iOS UIImagePicker compression or other compression techniques. Before publishing to the server, you need to shrink resolution to streaming video resolution (1280x720). By default, the package `image_picker` does it for you.
### Example
Please check the usage of this package in this example project https://github.com/sxudan/lets-watch
### License
This project is licensed under the MIT License - see the LICENSE file for details.
近期下载者:
相关文件:
收藏者: