AgoraIO-Community / AgoraWebSDK-NG

The Next Generation of Agora Web SDK
https://agoraio-community.github.io/AgoraWebSDK-NG/
161 stars 75 forks source link

How to eliminate the delay when you press Stop Screen Sharing #150

Open 8432konia opened 3 years ago

8432konia commented 3 years ago

When I stop screen sharing, there is a delay of about 5 seconds for the other side to be stopped. \ I want to stop them almost simultaneously.

Log of the side that pressed stop.

18:58:48:644 Agora-SDK [DEBUG]: [function getTrackId(){return this._ID;}] track ended
18:58:48:656 Agora-SDK [DEBUG]: [track-b4cfe5d2] stop audio playback
18:58:48:664 Agora-SDK [DEBUG]: [track-track-26724593] stop video playback
18:58:48:675 Agora-SDK [DEBUG]: [track-26724593] video-element-status change playing => abort
18:58:48:676 Agora-SDK [DEBUG]: [track-26724593] video-element-status change abort => emptied
18:58:57:478 Agora-SDK [DEBUG]: [client-34d29] receive exception msg, code: 1003, msg: SEND_VIDEO_BITRATE_TOO_LOW, uid: 536187233
18:58:58:836 Agora-SDK [DEBUG]: [client-b7a68] stream removed with uid 536187233
18:58:58:836 Agora-SDK [DEBUG]: [client-b7a68-sub-4] update subscribe options [a: false, v: true] -> [a: false, v: false]
18:58:58:837 Agora-SDK [INFO]: [track-track-26724593] is destroyed
18:58:58:839 Agora-SDK [INFO]: [client-b7a68] remote user 536187233 unpublished video track
18:58:58:858 Agora-SDK [DEBUG]: [track-b4cfe5d2] start audio playback
18:58:58:859 Agora-SDK [DEBUG]: [track-track-b4cfe5d2] use audio element to play

Log of the side where the stop is pressed

18:58:59:435 Agora-SDK [DEBUG]: [client-5a72a] stream removed with uid 536187233
18:58:59:436 Agora-SDK [DEBUG]: [client-5a72a-sub-3] update subscribe options [a: false, v: true] -> [a: false, v: false]
18:58:59:437 Agora-SDK [INFO]: [track-track-9a4563d6] is destroyed
18:58:59:440 Agora-SDK [DEBUG]: [track-track-9a4563d6] stop video playback
18:58:59:442 Agora-SDK [INFO]: [client-5a72a] remote user 536187233 unpublished video track
18:58:59:465 Agora-SDK [DEBUG]: [track-9a4563d6] video-element-status change playing => abort
18:58:59:466 Agora-SDK [DEBUG]: [track-9a4563d6] video-element-status change abort => emptied
yoreland commented 3 years ago

Just quick check, can you reproduce the same on https://webdemo.agora.io/agora-websdk-api-example-4.x/shareTheScreen/index.html

Per my side remote side will see stream disappear immediately

8432konia commented 3 years ago

I couldn't get a reproduction on my end X (

It works fine from the link above...

Log of the side that pressed stop.

 23:06:42:503 Agora-SDK [DEBUG]: [track-track-7eba60bc] stop video playback
 23:06:42:527 Agora-SDK [DEBUG]: [track-7eba60bc] close
 23:06:42:528 Agora-SDK [DEBUG]: [track-30d68695] stop audio playback
 23:06:42:528 Agora-SDK [DEBUG]: [track-30d68695] stop audio playback
 23:06:42:528 Agora-SDK [DEBUG]: [track-30d68695] close
 23:06:42:536 Agora-SDK [INFO]: [client-dbeba] Leaving channel
 23:06:42:537 Agora-SDK [DEBUG]: [client-dbeba] reset client
 23:06:42:541 Agora-SDK [DEBUG]: [track-7e344544] stop audio playback
 23:06:42:549 Agora-SDK [DEBUG]: [track-track-cdc444be] stop video playback
 23:06:42:591 Agora-SDK [DEBUG]: [client-dbeba-sub-2] update subscribe options [a: true, v: true] -> [a: false, v: false]
 23:06:42:592 Agora-SDK [INFO]: [track-track-7e344544] is destroyed
 23:06:42:592 Agora-SDK [DEBUG]: [track-7e344544] stop audio playback
 23:06:42:593 Agora-SDK [INFO]: [track-track-cdc444be] is destroyed
 23:06:42:594 Agora-SDK [DEBUG]: [lock-client-publish-8] is created.
 23:06:42:594 Agora-SDK [DEBUG]: [lock-client-leave-3] is locked, current queue 1.
 23:06:42:627 Agora-SDK [INFO]: [client-dbeba] connection state change: CONNECTED -> DISCONNECTING
 23:06:42:634 Agora-SDK [DEBUG]: [track-7eba60bc] video-element-status change playing => abort
 23:06:42:634 Agora-SDK [DEBUG]: [track-7eba60bc] video-element-status change abort => emptied
 23:06:42:636 Agora-SDK [DEBUG]: [track-cdc444be] video-element-status change playing => abort
 23:06:42:637 Agora-SDK [DEBUG]: [track-cdc444be] video-element-status change abort => emptied
 23:06:42:803 Agora-SDK [DEBUG]: [signal] websocket closed, reason: LEAVE
 23:06:42:804 Agora-SDK [INFO]: [client-dbeba] connection state change: DISCONNECTING -> DISCONNECTED
 23:06:42:804 Agora-SDK [DEBUG]: [client-dbeba] reset client
 23:06:42:805 Agora-SDK [DEBUG]: [lock-client-publish-9] is created.
 23:06:42:806 Agora-SDK [INFO]: [client-dbeba] Leaving channel success
 23:06:42:806 Agora-SDK [DEBUG]: [lock-client-leave-3] is not locked, current queue 0.

Log of the side where the stop is pressed

23:06:42:800 Agora-SDK [DEBUG]: [client-6069d] stream removed with uid 3273727964
23:06:42:800 Agora-SDK [DEBUG]: [client-6069d-sub-1] update subscribe options [a: true, v: true] -> [a: false, v: false]
23:06:42:801 Agora-SDK [INFO]: [track-track-6dc0ff06] is destroyed
23:06:42:801 Agora-SDK [DEBUG]: [track-6dc0ff06] stop audio playback
23:06:42:803 Agora-SDK [INFO]: [track-track-3b19f5e7] is destroyed
23:06:42:806 Agora-SDK [DEBUG]: [track-track-3b19f5e7] stop video playback
23:06:42:807 Agora-SDK [INFO]: [client-6069d] remote user 3273727964 unpublished audio track
23:06:42:808 Agora-SDK [INFO]: [client-6069d] remote user 3273727964 unpublished video track
23:06:42:808 Agora-SDK [DEBUG]: [client-6069d] user offline 3273727964 reason: Quit
23:06:42:853 Agora-SDK [DEBUG]: [track-3b19f5e7] video-element-status change playing => abort
23:06:42:853 Agora-SDK [DEBUG]: [track-3b19f5e7] video-element-status change abort => emptied