apivideo / api.video-flutter-live-stream

Flutter RTMP live stream client. Made with ♥ by api.video
MIT License
70 stars 41 forks source link

[Bug]: Live stream not working, only video #53

Closed JoinTheRace closed 6 months ago

JoinTheRace commented 7 months ago

Version

v1.2.0

Which operating systems have you used?

Environment that reproduces the issue

Flutter Emulator (Nexus 6 API 34)

Is it reproducible in the example application?

Yes

RTMP Server

api.video

Reproduction steps

First try:

1) import code from https://github.com/apivideo/api.video-flutter-live-stream.git 2) Flutter app is running in the emulator 3) Entered in the video id field the "api.video Live stream Id" (Live-stream is running, Player link works in internet explorer) 4) Black video

Second try:

1) import code from https://github.com/apivideo/api.video-flutter-live-stream.git 2) change all videoOptions in the code => videoOptions = VideoOptions(videoId: "api.video Live stream Id") 3) Black video

Third try:

... same as second try set option in PlayerSdk => live: true still black video

window.player$textureId = new PlayerSdk( "#playerDiv$textureId", { id: "${player.videoOptions!.videoId}", chromeless: true, live: true, autoplay: ${player.autoplay}, }

Expected result

live stream is playing in app

Actual result

black screen, no error message

Additional context

Attention: it can only be selected up to version v1.1.1, latest version is v1.2.0! I was using the v1.2.0 (not like indicated the v1.1.1)

Relevant logs output

if i take a "video id" of a recorded video, the video is playing... but not if I take the live-stream-ID. But Live-stream-ID works in a in the internet browser (if I copy the Player link)

thank you for your help
ThibaultBee commented 7 months ago

Hi,

Thanks for reporting the missing versions.

Could you test with a real device instead? Emulator are so slow, they don't behave well with live stream. I suggest to test on real device instead. Maybe if you lower the video and audio settings (resolution, bitrate) for you tests, it could work.

If you are insterested, we also provide a video player for Flutter: https://github.com/apivideo/api.video-flutter-player

JoinTheRace commented 7 months ago

Hi Thibault,

I important your directory from GitHub again (just to be 100% shure to have the same code) => https://github.com/apivideo/api.video-flutter-player.git

I uploaded the app on a real device (like you said)... It is a Redmi Note 8 Pro, MIUI Global 12.0.8 (QGGMIXM) Stabil.

Your Demo-Video runs well. So I assume the device is capable of running the stream.

I started a live stream on api.video and I streamed with a handy and a GoPro. Live stream is running stable... I copied the Player link to check in an internet explorer... works perfectly. BUT if I copy the "Live stream Id", the video player in the app shows a black video... So the same effect as in the emulator...

If I put manually the video id in the "Enter a video id"-Box and press enter, the following message is shown in the Debug console:

D/InputConnectionAdaptor(22083): The input method toggled cursor monitoring on I/System.out(22083): [okhttp]:check permission begin! W/System (22083): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar I/System.out(22083): [okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils D/InputConnectionAdaptor(22083): The input method toggled cursor monitoring off I/System.out(22083): [OkHttp] sendRequest>> I/System.out(22083): [OkHttp] sendRequest<< E/Volley (22083): [1620] NetworkUtility.shouldRetryException: Unexpected response code 404 for https://vod.api.video/vod/li7UdIRwwNa8b7orTRWH3BwD/thumbnail.jpg W/MediaDescriptionAdapter(22083): Failed to load thumbnail W/MediaDescriptionAdapter(22083): com.android.volley.ClientError W/MediaDescriptionAdapter(22083): at com.android.volley.toolbox.NetworkUtility.shouldRetryException(NetworkUtility.java:193)

W/MediaDescriptionAdapter(22083): at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:145)

W/MediaDescriptionAdapter(22083): at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:132)

W/MediaDescriptionAdapter(22083): at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)

W/MediaDescriptionAdapter(22083): at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)

As there is an "thumbnail" error in... I added a "thumbnail" in my stream... But still the same error if I click enter...

D/InputConnectionAdaptor(27042): The input method toggled cursor monitoring on I/System.out(27042): [okhttp]:check permission begin! W/System (27042): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar I/System.out(27042): [okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils I/System.out(27042): [OkHttp] sendRequest>> I/System.out(27042): [OkHttp] sendRequest<< D/InputConnectionAdaptor(27042): The input method toggled cursor monitoring off E/Volley (27042): [2012] NetworkUtility.shouldRetryException: Unexpected response code 404 for https://vod.api.video/vod/li7UdIRwwNa8b7orTRWH3BwD/thumbnail.jpg W/MediaDescriptionAdapter(27042): Failed to load thumbnail W/MediaDescriptionAdapter(27042): com.android.volley.ClientError W/MediaDescriptionAdapter(27042): at com.android.volley.toolbox.NetworkUtility.shouldRetryException(NetworkUtility.java:193)

W/MediaDescriptionAdapter(27042): at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:145)

W/MediaDescriptionAdapter(27042): at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:132)

W/MediaDescriptionAdapter(27042): at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)

W/MediaDescriptionAdapter(27042): at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)

If I cklick "pause" and then "play" the following message is shown in the Debug console:

I/System.out(27042): [okhttp]:check permission begin! W/System (27042): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar I/System.out(27042): [okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils I/System.out(27042): [OkHttp] sendRequest>> I/System.out(27042): [OkHttp] sendRequest<< E/Volley (27042): [2011] NetworkUtility.shouldRetryException: Unexpected response code 404 for https://vod.api.video/vod/li7UdIRwwNa8b7orTRWH3BwD/thumbnail.jpg W/MediaDescriptionAdapter(27042): Failed to load thumbnail W/MediaDescriptionAdapter(27042): com.android.volley.ClientError W/MediaDescriptionAdapter(27042): at com.android.volley.toolbox.NetworkUtility.shouldRetryException(NetworkUtility.java:193)

W/MediaDescriptionAdapter(27042): at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:145)

W/MediaDescriptionAdapter(27042): at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:132)

W/MediaDescriptionAdapter(27042): at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)

W/MediaDescriptionAdapter(27042): at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)

Live stream is still running well... I checked again at the end of all my tests...

Thank you very much for your help... I have been fighting with the code every evening sinca a week ...

BR Martin

Am Do., 25. Apr. 2024 um 09:55 Uhr schrieb Thibault Beyou < @.***>:

Hi,

Thanks for reporting the missing versions.

Could you test with a real device instead? Emulator are so slow, theydon't behave well with live stream. I suggest to test on real device instead.

— Reply to this email directly, view it on GitHub https://github.com/apivideo/api.video-flutter-live-stream/issues/53#issuecomment-2076591134, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHU2WAANTMZZJKUEAQGZ3TDY7CZH3AVCNFSM6AAAAABGXSDZ3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZWGU4TCMJTGQ . You are receiving this because you authored the thread.Message ID: @.***>

ThibaultBee commented 6 months ago

With the player, you are trying to play a live stream as a VOD. In the player, replace VideoType.vod by VideoType.live here. Sorry for this, this is something we should explicit in the example.

JoinTheRace commented 6 months ago

Perfect, I will try that as soon as possible. Thank you very much for your help. BR Martin

Am Do., 2. Mai 2024 um 10:35 Uhr schrieb Thibault Beyou < @.***>:

With the player, you are trying to play a live stream as a VOD. In the player, replace VideoType.vod by VideoType.live here https://github.com/apivideo/api.video-flutter-player/blob/902bb6a66a524ccbb9205ca9178fe392b10cf091/example/lib/main.dart#L35 . This is something we should explicit in the example.

— Reply to this email directly, view it on GitHub https://github.com/apivideo/api.video-flutter-live-stream/issues/53#issuecomment-2089904478, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHU2WACZV4E4JJY6CUGTSITZAH3G7AVCNFSM6AAAAABGXSDZ3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBZHEYDINBXHA . You are receiving this because you authored the thread.Message ID: @.***>

ThibaultBee commented 6 months ago

If you update the code of the example, it will be fixed. The type will be infered from the media id (either video Id or live stream id).

ThibaultBee commented 6 months ago

I guess your issue is resolved, so I am closing it.