ossrs / flutter_live

Live streaming player, iOS+Android, RTMP/HTTP-FLV/HLS/WebRTC, by Flutter+SRS.

Home Page:https://ossrs.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webrtc stream can NOT be played in flutter_live if pushing mp4 video file like this

ryantan1 opened this issue · comments

clone git and build it successfully.
run it on android 9 os. push mp4 video file with following command:
./ffmpeg -re -i video.mp4 -c copy -f flv -y rtmp://ip:1935/live/mp4test

then webrtc://ip/live/mp4test can be played via SRS rtcplayer in browser while can NOT be played by flutter_live apk.

how to fix it? could you please give some hint? thanks a lot!

stream server is SRS4.0 which support RTC

try these two steps:

  1. the h5 rtcplayer will by default use the same protocol with demo html page, which usually the http. while flutter_live apk will by default use https. if your srs server doesn't provide valid https connection, the apk will failed to play
  2. if https can't be provided, you can append ?schema=http to the webrtc url, like webrtc://ip/live/mp4test?schema=http in this case, you also need add android:usesCleartextTraffic="true" to your example/android/app/src/main/AndroidManifest.xml in the application node to allow android connect to unsecure http site.

hope it helps