google chrome - WebRTC screen sharing more than once without reloading page -
hi i´m developing webrtc app. "video adviser", clients make video call sellers, , want sellers share screen (without losing video call). managed make work together, when client finishes call, , new client arrives, when seller tries share screen again (with new client) error occurs.
the error following one: enter image description here
i think problem screen sharing api not support ending , reopening screen share without refreshing window (this want, keep seller online , listening once finishes calls without refreshing entire page).
this code cancel screen sharing once client leaves call:
if(yourconn.getlocalstreams()[1] != null){ var screenstreaming = yourconn.getlocalstreams()[1]; yourconn.removestream(screenstreaming); screenstreaming.gettracks().foreach(track => track.stop()); }
i know code stops succesfully screen sharing dont understand why when create new screen sharing stream, error posted appears. need help.
by way, im using chrome.
thanks reading , sorry if dont asked clearly, first question.
starting , stopping screensharing possible more once. invalidstateerror sounds (vaguely) trying reuse id choosedesktopmedia passed in chromemediasourceid more once. not possible afaik , need call choosedesktopmedia again (and let user select screen again)
Comments
Post a Comment