In chrome, if a tab with the stream is inactive for some time the readyState of the media tracks becomes ended and they stop playing
Opened this issue · 1 comments
Describe the bug
In chrome, if a tab with the stream is inactive for some time the readyState of the media tracks becomes ended and they stop playing
SDK Logs
09:46:22:798 Agora-SDK [DEBUG]: [lock-client-leave-3] is created.
AgoraRTC_N-production.js?e671:383 09:46:22:798 Agora-SDK [DEBUG]: [lock-client-publish-4] is created.
AgoraRTC_N-production.js?e671:384 09:46:22:799 Agora-SDK [INFO]: [client-9d68f] Initializing AgoraRTC client v4.4.0 build: v4.4.0-0-g48538343(4/2/2021, 5:44:00 PM), mode: live, codec: vp8
AgoraRTC_N-production.js?e671:384 09:46:22:802 Agora-SDK [INFO]: [client-9d68f] set low stream parameter to {"width":160,"height":120,"framerate":15,"bitrate":65}
AgoraRTC_N-production.js?e671:384 09:46:22:803 Agora-SDK [INFO]: [client-9d68f] enable dual stream
AgoraRTC_N-production.js?e671:383 09:46:22:803 Agora-SDK [DEBUG]: [lock-client-leave-5] is created.
AgoraRTC_N-production.js?e671:383 09:46:22:803 Agora-SDK [DEBUG]: [lock-client-publish-6] is created.
AgoraRTC_N-production.js?e671:384 09:46:22:803 Agora-SDK [INFO]: [client-c460a] Initializing AgoraRTC client v4.4.0 build: v4.4.0-0-g48538343(4/2/2021, 5:44:00 PM), mode: live, codec: vp8
AgoraRTC_N-production.js?e671:384 09:46:23:273 Agora-SDK [INFO]: [client-9d68f] set client role to audience, level: undefined
AgoraRTC_N-production.js?e671:384 09:46:23:274 Agora-SDK [INFO]: [client-9d68f] start join channel a78278ea-1b02-4622-87a5-157a1c90a297@meetings
AgoraRTC_N-production.js?e671:384 09:46:23:274 Agora-SDK [INFO]: [client-9d68f] connection state change: DISCONNECTED -> CONNECTING
AgoraRTC_N-production.js?e671:383 09:46:23:274 Agora-SDK [DEBUG]: [client-9d68f] new Session 462AE31D7797B43D39E12116DBF2D8C9
AgoraRTC_N-production.js?e671:383 09:46:23:945 Agora-SDK [DEBUG]: getUserAccount Success 120 => 10021
AgoraRTC_N-production.js?e671:383 09:46:23:945 Agora-SDK [DEBUG]: [lock-config-distribute-2] is locked, current queue 1.
AgoraRTC_N-production.js?e671:383 09:46:23:947 Agora-SDK [DEBUG]: [client-9d68f] Connect to choose_server: https://webrtc2-ap-web-1.agora.io/api/v1
AgoraRTC_N-production.js?e671:383 09:46:23:948 Agora-SDK [DEBUG]: [client-9d68f] Connect to choose_server: https://webrtc2-2.ap.sd-rtn.com/api/v1
AgoraRTC_N-production.js?e671:383 09:46:24:282 Agora-SDK [DEBUG]: [config-distribute] get config distribute {}
AgoraRTC_N-production.js?e671:383 09:46:24:282 Agora-SDK [DEBUG]: [lock-config-distribute-2] is not locked, current queue 0.
AgoraRTC_N-production.js?e671:383 09:46:24:303 Agora-SDK [DEBUG]: [gateway-client-9d68f] start connect, url: wss://104-166-142-148.edge.sd-rtn.com:4708
AgoraRTC_N-production.js?e671:383 09:46:25:79 Agora-SDK [DEBUG]: [gateway-client-9d68f] websocket opened: wss://104-166-142-148.edge.sd-rtn.com:4708
AgoraRTC_N-production.js?e671:384 09:46:25:196 Agora-SDK [INFO]: [client-9d68f] connection state change: CONNECTING -> CONNECTED
AgoraRTC_N-production.js?e671:383 09:46:25:199 Agora-SDK [DEBUG]: [client-9d68f] Connected to gateway server
AgoraRTC_N-production.js?e671:384 09:46:25:200 Agora-SDK [INFO]: [client-9d68f] Joining channel success: a78278ea-1b02-4622-87a5-157a1c90a297@meetings
AgoraRTC_N-production.js?e671:383 09:46:25:600 Agora-SDK [DEBUG]: [client-9d68f] user online 134
AgoraRTC_N-production.js?e671:383 09:46:25:709 Agora-SDK [DEBUG]: [client-9d68f] stream added with uid 134, type video
AgoraRTC_N-production.js?e671:384 09:46:25:710 Agora-SDK [INFO]: [client-9d68f] remote user 134 published video
AgoraRTC_N-production.js?e671:383 09:46:25:712 Agora-SDK [DEBUG]: [lock-sub-134-7] is created.
AgoraRTC_N-production.js?e671:384 09:46:25:712 Agora-SDK [INFO]: [client-9d68f] subscribe user 134, mediaType: video
AgoraRTC_N-production.js?e671:383 09:46:25:712 Agora-SDK [DEBUG]: [lock-sub-134-7] is locked, current queue 1.
AgoraRTC_N-production.js?e671:383 09:46:25:739 Agora-SDK [DEBUG]: [client-9d68f] stream added with uid 134, type audio
AgoraRTC_N-production.js?e671:384 09:46:25:739 Agora-SDK [INFO]: [client-9d68f] remote user 134 published audio
AgoraRTC_N-production.js?e671:384 09:46:25:740 Agora-SDK [INFO]: [client-9d68f] subscribe user 134, mediaType: audio
AgoraRTC_N-production.js?e671:383 09:46:25:740 Agora-SDK [DEBUG]: [lock-sub-134-7] is locked, current queue 2.
AgoraRTC_N-production.js?e671:383 09:46:25:745 Agora-SDK [DEBUG]: [client-9d68f-sub-1] create and set offer success
AgoraRTC_N-production.js?e671:383 09:46:25:748 Agora-SDK [DEBUG]: [pc-1] ice candidate error stun:webcs.agora.io:3478, code: 701, STUN host lookup received error.
AgoraRTC_N-production.js?e671:383 09:46:25:749 Agora-SDK [DEBUG]: [pc-1] ice candidate error stun:webcs.agora.io:3478, code: 701, STUN host lookup received error.
2AgoraRTC_N-production.js?e671:383 09:46:25:749 Agora-SDK [DEBUG]: [pc-1] ice candidate error stun:104-166-142-148.edge.sd-rtn.com:4738, code: 701, STUN host lookup received error.
2AgoraRTC_N-production.js?e671:383 09:46:25:793 Agora-SDK [DEBUG]: [pc-1] ice candidate error turn:104-166-142-148.edge.sd-rtn.com:4738?transport=udp, code: 701, TURN host lookup received error.
AgoraRTC_N-production.js?e671:384 09:46:25:884 Agora-SDK [INFO]: [client-9d68f-sub-1] ice-state: sub p2p checking
AgoraRTC_N-production.js?e671:383 09:46:25:889 Agora-SDK [DEBUG]: [client-9d68f-sub-1] unused ontrack event audio
AgoraRTC_N-production.js?e671:383 09:46:25:889 Agora-SDK [DEBUG]: [client-9d68f-sub-1] subscribe ontrack: video MediaStream MediaStreamTrack
AgoraRTC_N-production.js?e671:383 09:46:25:890 Agora-SDK [DEBUG]: [client-9d68f-sub-1] get all subscribed tracks
AgoraRTC_N-production.js?e671:383 09:46:25:890 Agora-SDK [DEBUG]: [client-9d68f-sub-1] set answer success
AgoraRTC_N-production.js?e671:384 09:46:25:893 Agora-SDK [INFO]: [client-9d68f-sub-1] connection-state: sub p2p connecting
AgoraRTC_N-production.js?e671:383 09:46:25:999 Agora-SDK [DEBUG]: [pc-1] ice candidate error turn:104-166-142-148.edge.sd-rtn.com:4738?transport=tcp, code: 701, TURN host lookup received error.
AgoraRTC_N-production.js?e671:384 09:46:25:999 Agora-SDK [INFO]: [client-9d68f-sub-1] ice-state: sub p2p connected
AgoraRTC_N-production.js?e671:384 09:46:26:0 Agora-SDK [INFO]: [client-9d68f-sub-1] create remote video track: track-bf0c6f1f
AgoraRTC_N-production.js?e671:383 09:46:26:0 Agora-SDK [DEBUG]: [lock-sub-134-7] is not locked, current queue 1.
AgoraRTC_N-production.js?e671:384 09:46:26:0 Agora-SDK [INFO]: [client-9d68f] subscribe success user 134, mediaType: video
AgoraRTC_N-production.js?e671:383 09:46:26:1 Agora-SDK [DEBUG]: [track-track-bf0c6f1f] start video playback {"fit":"cover"}
AgoraRTC_N-production.js?e671:383 09:46:26:2 Agora-SDK [DEBUG]: [track-bf0c6f1f] video-element-status change none => init
AgoraRTC_N-production.js?e671:383 09:46:26:3 Agora-SDK [DEBUG]: [client-9d68f-sub-1] update subscribe options [a: false, v: true] -> [a: true, v: true]
AgoraRTC_N-production.js?e671:383 09:46:26:3 Agora-SDK [DEBUG]: [client-9d68f-sub-1] emit pc ontrack after subscribe audio MediaStreamTrack
AgoraRTC_N-production.js?e671:384 09:46:26:3 Agora-SDK [INFO]: create audio context
AgoraRTC_N-production.js?e671:384 09:46:26:5 Agora-SDK [INFO]: [client-9d68f-sub-1] create remote audio track: track-998d7d02
AgoraRTC_N-production.js?e671:383 09:46:26:5 Agora-SDK [DEBUG]: [client-9d68f] send subscribe change, audio: true, video: true
AgoraRTC_N-production.js?e671:383 09:46:26:5 Agora-SDK [DEBUG]: [pc-1] local candidate count 4
AgoraRTC_N-production.js?e671:383 09:46:26:10 Agora-SDK [DEBUG]: [track-bf0c6f1f] video-element-status change init => playing
AgoraRTC_N-production.js?e671:383 09:46:26:10 Agora-SDK [DEBUG]: [track-bf0c6f1f] video-element-status change playing => waiting
AgoraRTC_N-production.js?e671:383 09:46:26:117 Agora-SDK [DEBUG]: [lock-sub-134-7] is not locked, current queue 0.
AgoraRTC_N-production.js?e671:384 09:46:26:117 Agora-SDK [INFO]: [client-9d68f] subscribe success user 134, mediaType: audio
AgoraRTC_N-production.js?e671:383 09:46:26:117 Agora-SDK [DEBUG]: [track-998d7d02] start audio playback
AgoraRTC_N-production.js?e671:383 09:46:26:117 Agora-SDK [DEBUG]: [track-track-998d7d02] use audio element to play
AgoraRTC_N-production.js?e671:383 09:46:26:118 Agora-SDK [DEBUG]: [track-track-bf0c6f1f] start video playback {"fit":"cover"}
AgoraRTC_N-production.js?e671:383 09:46:26:118 Agora-SDK [DEBUG]: [track-998d7d02] start audio playback
AgoraRTC_N-production.js?e671:383 09:46:26:118 Agora-SDK [DEBUG]: [track-track-998d7d02] use audio element to play
AgoraRTC_N-production.js?e671:384 09:46:26:118 Agora-SDK [WARNING]: audio element play warning NotAllowedError: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
log @ AgoraRTC_N-production.js?e671:384
AgoraRTC_N-production.js?e671:384 09:46:26:118 Agora-SDK [WARNING]: detected audio element autoplay failed
log @ AgoraRTC_N-production.js?e671:384
AgoraRTC_N-production.js?e671:384 09:46:26:118 Agora-SDK [INFO]: detect audio element autoplay failed
AgoraRTC_N-production.js?e671:384 09:46:26:221 Agora-SDK [INFO]: [client-9d68f-sub-1] connection-state: sub p2p connected
AgoraRTC_N-production.js?e671:383 09:46:26:684 Agora-SDK [DEBUG]: [track-bf0c6f1f] video-element-status change waiting => canplay
AgoraRTC_N-production.js?e671:383 09:46:26:684 Agora-SDK [DEBUG]: [track-bf0c6f1f] video-element-status change canplay => playing
AgoraRTC_N-production.js?e671:383 09:46:27:10 Agora-SDK [DEBUG]: [track-bf0c6f1f] current video dimensions: 640 480
AgoraRTC_N-production.js?e671:383 09:46:27:202 Agora-SDK [DEBUG]: [track-track-bf0c6f1f] start video playback {"fit":"cover"}
AgoraRTC_N-production.js?e671:383 09:46:27:203 Agora-SDK [DEBUG]: [track-998d7d02] start audio playback
AgoraRTC_N-production.js?e671:383 09:46:27:203 Agora-SDK [DEBUG]: [track-track-998d7d02] use audio element to play
AgoraRTC_N-production.js?e671:383 09:46:30:799 Agora-SDK [DEBUG]: [client-9d68f] receive exception msg, code: 2002, msg: AUDIO_OUTPUT_LEVEL_TOO_LOW, uid: 134
AgoraRTC_N-production.js?e671:383 09:47:05:500 Agora-SDK [DEBUG]: [pc-1] ice candidate error stun:webcs.agora.io:3478, code: 701, STUN allocate request timed out.
AgoraRTC_N-production.js?e671:383 09:47:25:993 Agora-SDK [DEBUG]: [client-9d68f] receive exception msg, code: 4002, msg: AUDIO_OUTPUT_LEVEL_TOO_LOW_RECOVER, uid: 134
AgoraRTC_N-production.js?e671:383 09:47:30:993 Agora-SDK [DEBUG]: [client-9d68f] receive exception msg, code: 2002, msg: AUDIO_OUTPUT_LEVEL_TOO_LOW, uid: 134
AgoraRTC_N-production.js?e671:383 09:48:10:500 Agora-SDK [DEBUG]: [client-9d68f] receive notification: Objectaction: "quit"code: 2003detail: "ERR_REPEAT_JOIN"option: ""proto: Object
AgoraRTC_N-production.js?e671:383 09:48:10:500 Agora-SDK [DEBUG]: [signal] websocket closed, reason: SERVER_ERROR
AgoraRTC_N-production.js?e671:384 09:48:10:501 Agora-SDK [INFO]: [client-9d68f] connection state change: CONNECTED -> DISCONNECTED
AgoraRTC_N-production.js?e671:383 09:48:10:501 Agora-SDK [DEBUG]: [client-9d68f] reset client
AgoraRTC_N-production.js?e671:383 09:48:10:501 Agora-SDK [DEBUG]: [track-998d7d02] stop audio playback
AgoraRTC_N-production.js?e671:383 09:48:10:502 Agora-SDK [DEBUG]: [track-track-bf0c6f1f] stop video playback
AgoraRTC_N-production.js?e671:383 09:48:10:502 Agora-SDK [DEBUG]: [client-9d68f-sub-1] update subscribe options [a: true, v: true] -> [a: false, v: false]
AgoraRTC_N-production.js?e671:384 09:48:10:502 Agora-SDK [INFO]: [track-track-998d7d02] is destroyed
AgoraRTC_N-production.js?e671:383 09:48:10:503 Agora-SDK [DEBUG]: [track-998d7d02] stop audio playback
AgoraRTC_N-production.js?e671:384 09:48:10:503 Agora-SDK [INFO]: [track-track-bf0c6f1f] is destroyed
AgoraRTC_N-production.js?e671:383 09:48:10:503 Agora-SDK [DEBUG]: [lock-client-publish-8] is created.
AgoraRTC_N-production.js?e671:383 09:48:10:512 Agora-SDK [DEBUG]: [track-bf0c6f1f] video-element-status change playing => abort
AgoraRTC_N-production.js?e671:383 09:48:10:512 Agora-SDK [DEBUG]: [track-bf0c6f1f] video-element-status change abort => emptied
Channel: a78278ea-1b02-4622-87a5-157a1c90a297@meetings
UID: 120
Platform and Browser: Ubuntu 20.04, Chrome 91
SDK Version: 4.4.0
To Reproduce
Steps to reproduce the behavior:
- Start live
- Connect one user as host and one as the audience
- For the audience leave the tab inactive or lock the os and unlock it
- See that the video track is not playing (just dark screen) and the mediaStreamTrack.readyState of the video is ended
Additional context
Probably it is somehow connected to the case that the audience user was connected with the same uid from 2 devices.
Well, to be honest, I can't reproduce it every time. It happens from time to time, but an inactive tab is always involved.