mjpeg_stream
一個用於透過 HTTP 傳輸 MJPEG(運動 JPEG)影片的 Flutter 套件
MohammedShamseerPV/MJPEG-Stream open-source repository details.
以下為英文專案原文快照,最新內容請造訪 GitHub。
Welcome to MJPEG Stream Flutter Package! 🚀 This package allows you to stream MJPEG video in your Flutter application easily. Perfect for real-time camera feeds and IP camera streaming. 📷🎥
https://github.com/user-attachments/assets/c908688e-3cd0-45bc-a21b-359df1eac6a5
Run this command:
With Flutter:
flutter pub add mjpeg_stream
Add this package to your pubspec.yaml:
dependencies:
mjpeg_stream: latest_version
OR
mjpeg_stream:
git:
url: https://github.com/MohammedShamseerPV/MJPEG-Stream.git
ref: main # Optional: specify the branch (default is 'main')
Then, run:
flutter pub get
Import the package:
import 'package:mjpeg_stream/mjpeg_stream.dart';
import 'package:flutter/material.dart';
import 'package:mjpeg_stream/mjpeg_stream.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'MJPEG Stream Example',
home: Scaffold(
appBar: AppBar(title: Text("MJPEG Stream")),
body: Center(
child: MJPEGStreamScreen(
streamUrl: "http://your-ip-camera-url/video.mjpg",
width: 300.0,
height: 200.0,
fit: BoxFit.cover,
),
),
),
);
}
}
Run this command:
With Flutter:
flutter pub add mjpeg_stream
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
dependedfdfdfncies:
mjpeg_stream: ^latest_version
dependencies:
mjpeg_stream: ^latest_version
Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:mjpeg_stream/mjpeg_stream.dart';
| Property | Type | Description |
|---|---|---|
streamUrl |
String |
The URL of the MJPEG stream. |
fit |
BoxFit |
Defines how the image should be inscribed into the widget. Default: BoxFit.cover. |
width |
double |
Width of the stream display. Default: double.infinity. |
height |
double |
Height of the stream display. Default: 300.0. |
timeout |
Duration |
Timeout for the network request. Default: 5 seconds. |
enableLogging |
bool |
Enables logging for debugging. Default: false. |
enableLogging: true.This package is open-source under the MIT License. Feel free to contribute! 😊
👨💻 Happy Coding! 🚀
If you found this package useful, consider supporting my work:
Uploading qr-code-phonePay.png…
依賴清單 4 項
{"sdk":"flutter"}^1.2.2{"sdk":"flutter"}^3.0.0先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗