Closed jeetvirani closed 4 years ago
Same question, it works by loading the computer version on mobile so why are they forcing using the app ? It must have a workaround as it just checks user agent.
Just found a way, just add that in your index.html after the first <script>
:
Object.defineProperty(navigator, 'userAgent', {
get: function () { return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'; }
});
Hi @Entretoize, your solution looks promising but doesn't work for me unfortunately, I still can't get the Jitsi Meet API to load on Webview Android (react-native-webview@5.12.1). I don't get passed the warning to install the Jitsi app. I tried various user agents, no luck. Are you using more or less the same script as in https://github.com/jitsi/jitsi-meet/blob/master/doc/examples/api.html? If not, any chance you can post your script? Perhaps other settings also influence the environment detection in the Jitsi API...
My solution is for a mobile web browser. It could work in a webview, with that user agent, but with the right permissions and some javascript trick maybe I remember the webview needs some javascript custom handling. I'm using jitsi "as is" on debian, I used the quick install guide.
Actually the answer is simpler than I thought, in the case of React Native: react-native-webview
has a userAgent
property. Setting it to a desktop value, such as 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/80.0.3987.163 Chrome/80.0.3987.163 Safari/537.36'
, bypasses the warning and brings Jitsi Meet on Webview.
@Entretoize I took code from an example, and I tried your approach but it doesn't work for me
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
</head>
<body>
<script>
Object.defineProperty(window.navigator, 'userAgent', {
get: function () { return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/80.0.3987.163 Chrome/80.0.3987.163 Safari/537.36'; }
});
</script>
<script src="https://meet.jit.si/external_api.js"></script>
<script>
var domain = "meet.jit.si";
var options = {
roomName: "JitsiMeetAPIExample1221121212",
width: 700,
height: 500,
parentNode: undefined,
configOverwrite: {},
interfaceConfigOverwrite: {
filmStripOnly: true
}
}
var api = new JitsiMeetExternalAPI(domain, options);
</script>
</body>
</html>
Try this:
configOverwrite: {
disableDeepLinking: true
},
Note that this won't work on iOS because we need to make some Safari fixes and last I checked web viewss don't have WebRTC support.
@Entretoize I took code from an example, and I tried your approach but it doesn't work for me
I'm not using the external api, I installed jitsi-meet on my own server.
@saghul On Android, Webview (from v36) has WebRTC support:
Not quite sure about WKWebView on iOS.
@dmelechow You are using filmStripOnly: true
was that intentional? Remove that it should just work.
@saghul Unfortunately, this approach doesn't work too, I removed filmStripOnly: true
and used this configOverwrite: { disableDeepLinking: true },
but whatever I can't turn on audio/video and I got some warning message
If you are building a android app, maybe permission are missing in manifest or not clearly asked to user. Or you are using an iframe ?
@Entretoize I tried to build the web application with
<script src="https://meet.jit.si/external_api.js"></script>
in Html file and try to run in it in a browser with "toggle device" with mobile preview resolution
@dmelechow I just tested the Jitsi Meet external API on Android Webview and I can confirm that it fails to access the camera and microphone. The problem is that the API serves Jitsi Meet inside an iframe, which for some reason fails to obtain the permissions given to the Webview. If you just pass the Jitsi Meet URL (https://meet.jit.si/<someConferenceID>#config.disableDeepLinking=true
) to the Webview, instead of the API, then everything works fine: The Webview requests the camera and microphone permissions, and you get video and sound.
One problem with the iframe could be that the Jitsi Meet API server does not pass the "Access-Control-Allow-Origin":"*"
CORS header. AFAIK, this would be required for Jitsi Meet to access hardware permissions behind an iframe inside Webview. @saghul, can you confirm this?
I already succeded in using jitsi-meet in an iframe with that code:
But was the source https://meet.jit.si, or a self-hosted version? As I wrote above, it probably works only if the web server for the source provides the "Access-Control-Allow-Origin":"*"
CORS header. I believe the Jitsi Meet API already provides the allow="camera;microphone"
directive in the iframe, so that should not be the problem.
It was on the self hosted version, but I just tried in an android webview with the meet.jit.si and the camera and microphone works and are streamed. I added the following permissions in the manifest:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MICROPHONE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
And needed to request permission from the user:
Manifest.Permission.RecordAudio
I use the exact same permission settings. Do you pass https://meet.jit.si
as a URL parameter to the Webview, or are you building the HTML using <script src="https://meet.jit.si/external_api.js"></script>
?
I just pass https://meet.jit.si. EDIT: I just tried with your code:
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
</head>
<body>
<script src="https://meet.jit.si/external_api.js"></script>
<script>
var domain = "meet.jit.si";
var options = {
roomName: "JitsiMeetAPIExample1221121212",
width: 700,
height: 500,
parentNode: undefined,
configOverwrite: {},
interfaceConfigOverwrite: {
filmStripOnly: true
}
}
var api = new JitsiMeetExternalAPI(domain, options);
</script>
</body>
</html>
And it worked too. But one question, where do you put this code ? I put it on my website and call the url, maybe that's the diffrence ?
Yes I think that is the difference. Your web server must somehow provide the required CORS header (https://tecadmin.net/enable-cors-apache/), while the https://meet.jit.si server does not.
Webview has both a source.html
parameter and a url
parameter. You can put the Jitsi Meet API code in the source
parameter, and leave the url
parameter empty.
In React Native, it would be:
const html =
`<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
</head>
<body>
<script src="https://meet.jit.si/external_api.js"></script>
<script>
...
</script>
</body>
</html>`;
then call the Webview like this:
<WebView
source={{
html: html,
}}
mediaPlaybackRequiresUserAction={ false }
allowsInlineMediaPlayback={ true }
/>
@Entretoize I don't have any mobile apps, I only use jitsi in my ReactJs project in desktop and mobile browser, on desktop everything is working perfectly, but in a mobile browser, there are problems 1. You need to use native jitsi app 2. configOverwrite: { disableDeepLinking: true }
when I use this I can't turn on the audio, for simplicity I was trying to the code from doc in the pure .HTML file.
In my pure .HTML I use this code
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
</head>
<body>
<script src="https://meet.jit.si/external_api.js"></script>
<script>
var domain = "meet.jit.si";
var options = {
roomName: "JitsiMeetAPIExample1221121212",
width: 700,
height: 500,
parentNode: undefined,
configOverwrite: {
disableDeepLinking: true
}
}
var api = new JitsiMeetExternalAPI(domain, options);
</script>
</body>
</html>
@Entretoize I tried the Jisti Meet API HTML code in a static web page, which I call in the Android Webview using the URL parameter. This works perfectly well and I now have access to video and sound in the Webview, with no failed access error. I am not quite sure anymore why calling the same HTML directly in the Webview doesn't work. Is it a CORS issue, a security feature in Webview, a bug?
I also tested my web page on Chrome and Firefox on Android and it works well. The UI design of Jitsi Meet is not yet well adapted for mobile devices, but I think this will get better eventually.
Unfortunately, things don't look as good on iOS. Chrome doesn't even have access to camera or microphone permissions at all. With Safari, I can access the microphone, but the video only shows a static image. I haven't tried yet the Webview on iOS, but it doesn't look like it supports WebRTC yet.
On my MacBook, an html page with the simplest embed works in Chrome. Unfortunately, if I turn on the developer tool set to emulate a phone, it fails to work, with this uninformative screen.
This "feature" was an enormous waste of time for me, and likely others. If this is by choice, it should at least be documented.
The workaround mentioned about by @saghul got me to a conference on mobile web, but as mentioned by @dmelechow, it disabled the camera / microphone.
Try this:
configOverwrite: { disableDeepLinking: true },
Note that this won't work on iOS because we need to make some Safari fixes and last I checked web viewss don't have WebRTC support.
This worked perfectly On an iPhone too
I mean I'm not really sure I used a simulator so I check back on iPhone and reply tomorrow
The option should now work fine.
In fact, we have landed open in browser support in master now.
Closing.
@iresharma @alariej - were you able to get this to work on a real iPhone? I am running into the same problem as other users where it is not letting me enable the camera or microphone. Works fine on Android though, but not on iOS.
@iresharma @alariej - were you able to get this to work on a real iPhone? I am running into the same problem as other users where it is not letting me enable the camera or microphone. Works fine on Android though, but not on iOS.
In my case sometimes it worked sometimes it didn't, I still wrapping my head around how to fix it
The worst part is some guy closed this issue stating it's fixed so I pushed to deployment and now my client is complaining again and again.
Hi, I try https://jitsinew.tinda.app/test with wkwebview ios but it unable to access camera and Microphone
Has anyone has the issue of turning off/on camera in mobile browser after enabling disableDeepLinking: true ?
I can mute/unmute mike though.
Any help would be appreciated.
I'm also facing same issue
hi there i am i am facing issue on mobile i am using external jitisi site api using iframe in a box for my site but on mobile device its says download app wevview is not working any 1 can help me p ![Uploading 79883823-fc465680-8411-11ea-98f3-05d8b816164d.png…]() ls?
for external api, try:
let domain = "meet.jit.si";
let options = {
roomName: 'test123',
width: '100%',
height: '100%',
userInfo: {
// email: 'email@jitsiexamplemail.com',
displayName: 'test321'
},
configOverwrite: {
requireDisplayName: false,
prejoinPageEnabled: false,
disableDeepLinking: true,
},
interfaceConfigOverwrite: {
MOBILE_APP_PROMO: false,
},
// parentNode: meetElement
}
let api = await new JitsiMeetExternalAPI(domain, options)
thank you
unable to join the meeting from react-native-webview . What might be the problem.
Not sure what the question is. What problem are you facing?
Not sure what the question is. What problem are you facing?
I solved the issue but is there way for going back to previous screen on react native after call ends
I have a web view screen for conference and I want each user to be redirected back to previous page when meeting ends
You'd need to detect the URL changes I think.
When i am running in desktop it is working fine. But when i am trying into Mobile browser or webview it is giving this error: You need the Jitsi Meet mobile app to join this meeting on your phone. Can anyone help me?