flutter_vlc_player icon indicating copy to clipboard operation
flutter_vlc_player copied to clipboard

How to reduce latency on Streaming to IOS?

Open burhanyldrm opened this issue 3 years ago • 3 comments

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"), ), ], ), ), ); } }

burhanyldrm avatar Jan 21 '23 08:01 burhanyldrm

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.

pauloamarcon avatar Jan 21 '23 14:01 pauloamarcon

After three weeks of searching, this problem was solved by adding ":rtsp-tcp" option like this: rtp: VlcRtpOptions([ VlcRtpOptions.rtpOverRtsp(true), ":rtsp-tcp", ]),

MustafaGaber avatar Jul 21 '23 22:07 MustafaGaber

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.

pauloamarcon avatar Aug 03 '23 12:08 pauloamarcon