webrtc stream can NOT be played in flutter_live if pushing mp4 video file like this
ryantan1 opened this issue · 2 comments
ryantan1 commented
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!
ryantan1 commented
stream server is SRS4.0 which support RTC
efinal commented
try these two steps:
- 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
- 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