How to reduce latency on Streaming to IOS?
Hi,
I'm using;
Flutter 2.2.1 Dart 2.13.1 XCode 12.5.1
My code:
// import 'dart:js_util';
import 'package:flutter/material.dart'; import 'package:flutter_vlc_player/flutter_vlc_player.dart'; import 'package:flutter_vlc_player/src/vlc_player_controller.dart';
void main() { runApp(MyApp()); }
class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } }
class MyHomePage extends StatefulWidget { MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override _MyHomePageState createState() => _MyHomePageState(); }
class _MyHomePageState extends State<MyHomePage> { VlcPlayerController _vlcViewController = VlcPlayerController.network( "rtsp://admin:..........................................................", autoPlay: true, options: VlcPlayerOptions( rtp: VlcRtpOptions([VlcRtpOptions.rtpOverRtsp(true)])));
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ new VlcPlayer( controller: _vlcViewController, aspectRatio: 16 / 9, placeholder: Text("Hello World"), ), ], ), ), ); } }
Apparently the problem only occurs with url containing user and password. I had the same issue and while it's not resolved I'm doing a restream using my own server. Try using without username and password to confirm this problem. It only happens with iOS... another problem is not being able to use a pure IPv6 connection. It has to do with something related to the VLC plugin itself and LIVE555.
After three weeks of searching, this problem was solved by adding ":rtsp-tcp" option like this: rtp: VlcRtpOptions([ VlcRtpOptions.rtpOverRtsp(true), ":rtsp-tcp", ]),
After three weeks of searching, this problem was solved by adding ":rtsp-tcp" option like this: rtp: VlcRtpOptions([ VlcRtpOptions.rtpOverRtsp(true), ":rtsp-tcp", ]),
I made the change, but still have the same problem. This problem only occurs on ios, on android I don't have this problem.