这是我的准则
import 'package:flutter/material.dart';
import 'package:flutter_vlc_player/flutter_vlc_player.dart';
class IPCameraScreen extends StatefulWidget {
final String url;
const IPCameraScreen({Key? key, required this.url}) : super(key: key);
@override
_IPCameraScreenState createState() => _IPCameraScreenState();
}
class _IPCameraScreenState extends State<IPCameraScreen> {
late VlcPlayerController _vlcController;
@override
void initState() {
super.initState();
_initializePlayer();
}
@override
void dispose() {
_vlcController.dispose();
super.dispose();
}
void _initializePlayer() {
_vlcController = VlcPlayerController.network(
// widget.url,
'rtsp://192.168.100.208:80/rtsp/streaming?channel=5&subtype=1',
hwAcc: HwAcc.full,
autoPlay: true,
options: VlcPlayerOptions(),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('IP Camera Preview'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
VlcPlayer(
controller: _vlcController,
aspectRatio: 16 / 9,
placeholder: const Center(child: CircularProgressIndicator()),
),
],
),
),
);
}
}
错误->>未处理的异常:PlatformException(channel-error,无法在通道上建立连接。,null,null)
如果macos不支持https://pub.dev/packages/flutter_vlc_player与此软件包。告诉我哪个软件包rtsp支持macos和windows??
1条答案
按热度按时间fgw7neuy1#
image