Reference Error :browser is not defined

prateek_sharma

New Member
sharbtn.onclick = startSharing();
function startSharing() {
var session = Flashphoner.getSessions()[0];
var constraints = {
video: {}
};
constraints.video.type = "screen";
constraints.video.withoutExtension = true;
session.createStream({
name:"desktop",
display: document.getElementById("screen-sharing"),
constraints: constraints
}).publish();
}
here is my code !can you please guide me why i am facing browser is not defined error thanks
 

Max

Administrator
Staff member
Good day.
Please check if the problem is reproducing in Screen Sharing example available on your WCS instance by URL https://wcs:8444/client2/examples/demo/streaming/screen-sharing/screen-sharing.html. If yes, please provide the following:
- OS and browser version
- WCS version
- Web SDK version
- full browser console log
If no, please modify the Screen Sharing example code minimally to reproduce the issue, and send this modified code using the form
 

prateek_sharma

New Member
Good day.
Please check if the problem is reproducing in Screen Sharing example available on your WCS instance by URL https://wcs:8444/client2/examples/demo/streaming/screen-sharing/screen-sharing.html. If yes, please provide the following:
- OS and browser version
- WCS version
- Web SDK version
- full browser console log
If no, please modify the Screen Sharing example code minimally to reproduce the issue, and send this modified code using the form
hello
when submitting the form i am getting this response
Cообщение <1621596295.60a798872a73f@flashphoner.com> для support@flashphoner.com не было доставлено через ApMailer\Smtp. Ошибка: 102: На этапе "Отправление письма" ожидался код 250, но сервер вернул 552 5.7.0 message content and attachment content guidelines. e22sm3999913edu.35 - gsmtp

i think the request is not sent successfully
 

prateek_sharma

New Member
Hello

Try to import this js file

It seems flashphoner.js has dependency on Browser variable of utils.js
We will double check screen sharing embedding example https://flashphoner.com/embedding-webcam-broadcasting-in-a-browser-to-a-web-page-2/
thanks max
its working but i have a question in utils.js
there is function (line number 117)

$(function () {.....})
if i have to import this js file and run my code it gives me error utils.js:117 Uncaught ReferenceError: $ is not defined
and also gives me TypeError: Cannot read property 'isChrome' of undefined
and my app not sharing the screen

so what i did is i use
(function () {.....}) instead of using $(function () {.....})
and now its working and screen sharing successfully run

it seems utils.js file that you provided having issue
please look at that
 

Max

Administrator
Staff member
We have raised internal ticket WCS-3195. Will keep you informed.
 

Max

Administrator
Staff member
Good day.
We fixed the unnecessary dependencies issue in WebSDK build 2.0.169. Screen sharing minimal example described here should now work in Chrome browser without utils.js or other dependencies.
 
Top