flutter_vlc_player icon indicating copy to clipboard operation
flutter_vlc_player copied to clipboard

How can I enable and use the rtp feature for iOS? can you give an example

Open burhanyldrm opened this issue 3 years ago • 1 comments

burhanyldrm avatar Jan 21 '23 08:01 burhanyldrm

I am using RTP for android, but maybe it will work for iOS too. I have a SDP file saved in the app docs with the following content:

v=0
m=video 1234 RTP/AVP 96
c=IN IP4 172.0.0.1
a=rtpmap:96 H264/90000

The RTP is broadcasted to the mobile device IP + port 1234.

I then play the stream using:

_videoVlcController = VlcPlayerController.file(
        File("$pathToSdpFile"),
        autoPlay: true,
);

If you can't have a file downloaded by the user, you can write it and save it before you need to read it using something like:

File sdp = File(pathToSdpFile!);
    if (!await sdp.exists()) {
      sdp.writeAsString("v=0\nm=video 1234 RTP/AVP 96\nc=IN IP4 172.0.0.1\na=rtpmap:96 H264/90000", mode: FileMode.append, flush: true);
    }

omerhertz avatar Feb 27 '23 10:02 omerhertz