mehrvarz / webcall-android

WebCall for Android - Web-Telephony P2P Messaging File-Exchange E2E-Encryption No-SIM
GNU General Public License v3.0
128 stars 14 forks source link

iphone couldn't listen #12

Closed NCHU611A closed 1 year ago

NCHU611A commented 1 year ago

Hello, When I call the android phone whose “webcall app” is installed with iphone (with ios15 or ios16), the android phone can hear the iphone, but iphone can’t hear the android phone. P.S. neither safari(iphone) nor chrome(iphone) can hear the android phone. Thanks.

mehrvarz commented 1 year ago

Hi,

A) With your iPhone call: https:// timur.mobi/user/answie7 (answering machine). Can hear the audio playback?

B) Try calling your Android device from another device, say, from a desktop Mac or another Android device.

If A works and B does not, the problem may be with your Android device. (System webview up to date?)

NCHU611A commented 1 year ago

With your iPhone call: https://timur.mobi/user/answie7 (answering machine). Can hear the audio playback?

No, I totally use 4 iPhones for testing but I still can't hear the voices. (neither safari app nor chrome app) Furthermore, when I use MacBook air (with safari), I can hear the voices.

Try calling your Android device from another device, say, from a desktop Mac or another Android device.

The Macbook air and another android device can do the two-way call to Android device(installed webcall app) , but the iphone can't.

And the version of webview I installed in android device(webcall app) is 105.0.5195.136.

mehrvarz commented 1 year ago

Hi NCHU611A,

No, I totally use 4 iPhones for testing but I still can't hear the voices.

Thank you for your report. I have not seen such an issue on the iPhone, yet. Can you do me a favor? Go to chrome://inspect and press Start Logging. Then open https://timur.mobi/userlog/answie7 in a new tab. After the call or after 30s switch back to the inspect tab and capture the complete log (may be 200 lines or more). Pls send me this log. You can find my e-mail address at the bottom of https://timur.mobi/webcall /Thank you

(/userlog/ produces more logs than /user/ but otherwise is the same)

NCHU611A commented 1 year ago

I have sent the email to you. Thank you for your helping.

mehrvarz commented 1 year ago

I received your log file. Thank you. Good work. For clarity:

NCHU611A commented 1 year ago

When you call with your iPhone, can you hear a dial sound (touch-tone) in the begining of the call?

no

Do you hear a hangup sound at the end of the call?

no

Is there 30-40s of silence in the middle of the call (where Jazz music should play back)? Or do you get a disconnect right away?

Yes, I can't even hear the jazz music. And I was connected then.

If you call with your macbook, you can hear all 3 sounds, correct?

When I call with macbook, I can only hear jazz music.

mehrvarz commented 1 year ago
  1. no

On further inspection I notice this in your log (line 49):

DialSound err=NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

Looks like the app has no permission to play (any?) audio. I am going to make this error-msg more visible in the UI.

  1. When I call with macbook, I can only hear jazz music.

On your macbook, did you turn the [x] Dial sounds checkbox off? (Like in this screen shot: https://timur.mobi/webcall/update/dial-sounds.jpg) It is totally fine to do this. But it would explain why you do not hear dial sounds on this machine.

NCHU611A commented 1 year ago

On your macbook, did you turn the [x] Dial sounds checkbox off? (Like in this screen shot: https://timur.mobi/webcall/update/dial-sounds.jpg) It is totally fine to do this. But it would explain why you do not hear dial sounds on this machine.

I dont find Dial sounds checkbox on Macbook air's safari. And i send my testing video to you.

NCHU611A commented 1 year ago

Looks like the app has no permission to play (any?) audio.

I find only https://timur.mobi/user/answie7 couldn't play audio, and microphone have permission but no use

And I have sent my testing video to you.

mehrvarz commented 1 year ago

I dont find Dial sounds checkbox on Macbook air's safari.

Ckeckbox can be found in the callee app: https://timur.mobi/callee/(your-ID) Did you earlier run the callee app on your Macbook? If so, run it again and turn the dial-sounds back on. You can also clear the WebCall cookie. Dial-sounds are enabled by default.

answie7 couldn't play audio (on iPhone)

I can see "NotAllowedError" is showing up in the UI. I don't think this is a WebCall specific issues. Does the browser itself have audio playback permission? Try: https://webaudioapi.com/samples/script-processor/

EDIT: Or better try this: https://webaudioapi.com/samples/audio-tag/ I would really like to see this resolved.

NCHU611A commented 1 year ago

Iphone( safari browser ) can do two-way conversation and work fine (including talk and hear).

Although iphone can hear sounds and talk , I find that iphone( safari browser) still show the message ' Error DialSound NotAllowedError. the request is not.....'.

And iphone(safari browser) and macbook air(safari browser) still can't hear 'dial sound', 'hang up sound' and 'ringtone'.

I'm sure 'Dial sounds checkboxg' is turn on.

I have tested these two websites https://webaudioapi.com/samples/script-processor/ and https://webaudioapi.com/samples/audio-tag/ with iphone(safari browser) and mafari acbook air(sbrowser), the result is both websites can play audio.

mehrvarz commented 1 year ago

Iphone( safari browser ) can do two-way conversation and work fine (including talk and hear).

Nice! This is what I did: I added attribute playsinline="" to the audio/video element as suggested in one of the replies to this post. This is there now only for AppleWebKit (605.1.15+) on iOS. It is not needed for Chrome and Firefox browsers. More about the playsinline attribute.

Although iphone can hear sounds and talk , I find that iphone( safari browser) still show the message ' Error DialSound NotAllowedError. the request is not.....'.

And iphone(safari browser) and macbook air(safari browser) still can't hear 'dial sound', 'hang up sound' and 'ringtone'.

Do these issues occur also if you operate the WebCall UI a little before you click the dial button (for instance if you open and close the hamburger menu first)? My assumption is that WebKit on iOS "detects" the dialsound, that is played back in response to the dial button being clicked, as some kind of "auto-play" (which it is not). So my question is what happens, if you interact a little more with the WebCall app, before you click the dial button. Thank you for patience.

NCHU611A commented 1 year ago

I have interacted a little more with the iphone (chorme app) (calleelog) page, and I have sent iphone (chorme app) (calleelog) <-------- android device (built-in browser app) test log to you. Hope this log is helpful for your testing.

mehrvarz commented 1 year ago

Your log contains this line: ringtone play The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

This is the same msg we saw with the dial-tone when making calls.

I have applied one change: I moved the loading of the ringtone file from onLoad to where an incoming call is handled (late or lazy loading). Can you try to receive a call with your iPhone again and tell me if you hear the ringtone now? Please make sure you clear the browser cache, so not to use a previous WebCall client. No log file required this time. Thank you.

NCHU611A commented 1 year ago

I still can't hear 'dial sound', 'hang up sound' and 'ringtone'(use iPhone) after I cleared the browser cache.

mehrvarz commented 1 year ago

I still can't hear 'dial sound', 'hang up sound' and 'ringtone'(use iPhone) after I cleared the browser cache.

In last step I only changed the callee app (ringtone), not the caller app (dial sound). But if you still can't hear the ringtone, then late loading of the audio file does not fix the issue.

Of course, it should not matter when an audio file is being LOADED. Only when it is PLAYED back should matter. The two apps never play back any audio without a preceeding user interaction. I was still a little hopeful. (Going to reverse the last modification now.)

The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

Unless someone comes up with an idea what may cause the above error message, I will suggest we wait for the next WebKit release (after 605.1.15) to arrive on iOS. Thank you for your support.

NCHU611A commented 1 year ago

Thanks! And I have another question that is when I use iphone(safari and chrome browser) call other divice(callee), the "Hand Up" button can press but not response(iPhone's safari and chrome browser)

I'm not sure that this question should be opened issue in which one repository webcall-android or webcall. thank you.

mehrvarz commented 1 year ago

when I use iphone(safari and chrome browser) call other divice(callee), the "Hand Up" button can press but not response(iPhone's safari and chrome browser)

If this happens only on iOS and only after you see the "not allowed / denied permission" message, it is most likely a followup issue.

Further up in this thread I pointed to this post, which says to use playsinline="" parameter. I now found this post that urges to use playsInline with a capital "I". Not sure if this makes a difference, but I modified the two WebCall apps to use the capital "I". Would you like to give it another try?

I'm not sure that this question should be opened issue in which one repository webcall-android or webcall. thank you.

I am fine taking care of it right here.

NCHU611A commented 1 year ago

when I use iphone(safari and chrome browser) call other divice(callee), the "Hand Up" button can press but not response(iPhone's safari and chrome browser)

If this happens only on iOS and only after you see the "not allowed / denied permission" message, it is most likely a followup issue.

When I pressed "Hand up" button with iphone(safari browser and chrome app), the WebCall page displayed a message "(Hand up) reject Button"


Not sure if this makes a difference

It is the same result. Still can't hear 'dial sound', 'hang up sound' and 'ringtone' on iPhone. Thank you!

mehrvarz commented 1 year ago

When I pressed "Hand up" button with iphone(safari browser and chrome app), the WebCall page displayed a message "(Hand up) reject Button"

Exact msg is "Hang up (rejectButton)". It means that peer disconnect has been invoked by the user (via button)". Nothing unusual or suspicious here. If you get "not response" from the Hangup button, it is likely because you hit the audio playback issue here again. This time for the busySound.

It is the same result. Still can't hear 'dial sound', 'hang up sound' and 'ringtone' on iPhone. Thank you!

OK. playsInline (with a capital "I") does not resolve the issue.

I am pretty certain we only have 1 issue. And this is audio playback. I have now implemented another change to fix this. Can you please give it one more try? (I modified both apps: caller and callee. Pls make sure you clear the cache.)

NCHU611A commented 1 year ago

Can you please give it one more try?

iPhone has 'dial sound', 'hang up sound' and 'ringtone' ! But the web page must be refreshed once.


And I found when use iphone(user) call ----> android device(callee), the "hand up" button (in iPhone) are unresponsive completely. After I press "hand up" button (in iPhone) , I can still hear human sound.

mehrvarz commented 1 year ago

Excellent! All I did was to move the LOADING of the audio to a different place. I did not change anything else. This change is only required for WebKit on iOS (not for macOS or any other OS or browser). In any case, I thank very much you for your patience.

iphone(user) call ----> android device(callee), the "hand up" button (in iPhone) are unresponsive completely. After I press "hand up" button (in iPhone) , I can still hear human sound.

Can you redo this with /userlog/ on the iPhone and email me the log? Only send me the log if you can reproduce the unresponsive situation.

NCHU611A commented 1 year ago

Can you redo this with /userlog/ on the iPhone and email me the log?

ok, I have sent my testing log to you.

mehrvarz commented 1 year ago

Findings: WebKit on iOS does not support the fullscreen functionality in Javascript, as other browsers do. WebCall "Hangup" feature has been using document.exitFullscreen(). On iPhone/iPad this would lead to an immediate abort of Javascript processing (without any error message). As a result the "Hangup" feature was never actually exected.

Solution: All use of fullscreen on/off has been deactivated on iPhone and iPad devices. The "Hangup" feature appears to be fully functional again.

mehrvarz commented 1 year ago

addendum:

You reported: when making a call with the iPhone, the dial-sound does not stop playing when the other side (callee) answers the call. This issue should now be resolved.

You pointed out that the hang-up issue exists also on Safari/MacOS (not just on WebKit/iOS). This issue should now be resolved as well. [ ] Full screen has not been removed from WebCall menu when it is executed on MacOS. However, this should cause no harm.

You also reported a black rectangle showing in place of the green or red LED. I was not yet able to solve this issue.

NCHU611A commented 1 year ago

< When making a call with the iPhone, the dial-sound does not stop playing when the other side (callee) answers the call. < This issue should now be resolved.

Yes.

< You pointed out that the hang-up issue exists also on Safari/MacOS (not just on WebKit/iOS). < This issue should now be resolved as well.

Yes.

< [ ] Full screen has not been removed from WebCall menu when it is executed on MacOS. < However, this should cause no harm.

Ok.

< You also reported a black rectangle showing in place of the green or red LED. < I was not yet able to solve this issue.

Understood.

Timur Mehrvarz @.***> 於 2022年10月23日 週日 晚上7:59寫道:

addendum:

You reported: when making a call with the iPhone, the dial-sound does not stop playing when the other side (callee) answers the call. This issue should now be resolved.

You pointed out that the hang-up issue exists also on Safari/MacOS (not just on WebKit/iOS). This issue should now be resolved as well. [ ] Full screen has not been removed from WebCall menu when it is executed on MacOS. However, this should cause no harm.

You also reported a black rectangle showing in place of the green or red LED. I was not yet able to solve this issue.

— Reply to this email directly, view it on GitHub https://github.com/mehrvarz/webcall-android/issues/12#issuecomment-1288096036, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3HPAWAELAG2Z2ODFIFIVGDWEUSCPANCNFSM6AAAAAAQT2BXBQ . You are receiving this because you modified the open/close state.Message ID: @.***>