mirror of https://github.com/OpenVidu/openvidu.git
Add check for navigator userAgent
parent
ac81abf7fd
commit
d15fb391f8
|
@ -3,15 +3,17 @@ var chromeMediaSource = 'screen';
|
||||||
var sourceId;
|
var sourceId;
|
||||||
var screenCallback;
|
var screenCallback;
|
||||||
var isFirefox = typeof window.InstallTrigger !== 'undefined';
|
var isFirefox = typeof window.InstallTrigger !== 'undefined';
|
||||||
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
var isOpera = !!window.opera || (navigator.userAgent && navigator.userAgent.indexOf(' OPR/') >= 0);
|
||||||
var isChrome = !!window.chrome && !isOpera;
|
var isChrome = !!window.chrome && !isOpera;
|
||||||
|
|
||||||
window.addEventListener('message', function (event) {
|
if(window.addEventListener){
|
||||||
|
window.addEventListener('message', function (event) {
|
||||||
if (event.origin != window.location.origin) {
|
if (event.origin != window.location.origin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
onMessageCallback(event.data);
|
onMessageCallback(event.data);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// and the function that handles received messages
|
// and the function that handles received messages
|
||||||
function onMessageCallback(data) {
|
function onMessageCallback(data) {
|
||||||
|
|
Loading…
Reference in New Issue