With cross-site (aka third-party) cookies are blocked , media streams will fail to play in a cross-origin iframe.
E.g. Chrome's Incognito mode, or Chrome and Firefox with Settings-> Privacy & Security -> Cookies and other site data -> Block third-party-cookies.
Reason
WebRtcStats::initWebRtcStats() throws a DOMException
When cross-site (aka third-party) cookies are blocked by the browser, accessing localStorage in a third-party iframe throws a DOMException.
Fix
When reading from localStorage treat (security) exceptions like absent values.
Apart from reading from localStorage in WebRtcStats::initWebRtcStats(), openvidu-browser does not access localStorage or sessionStorage anywhere else.
Fixes the issue
With cross-site (aka third-party) cookies are blocked , media streams will fail to play in a cross-origin iframe. E.g. Chrome's Incognito mode, or Chrome and Firefox with Settings-> Privacy & Security -> Cookies and other site data -> Block third-party-cookies.
Reason
WebRtcStats::initWebRtcStats()
throws aDOMException
When cross-site (aka third-party) cookies are blocked by the browser, accessing localStorage in a third-party iframe throws a DOMException.
Fix
When reading from
localStorage
treat (security) exceptions like absent values. Apart from reading fromlocalStorage
inWebRtcStats::initWebRtcStats()
,openvidu-browser
does not access localStorage or sessionStorage anywhere else.