bit6 / bit6-cordova

Bit6 Cordova Plugin - add rich messaging and WebRTC voice/video calling to iOS and Android apps
8 stars 12 forks source link

Android 7 crashes on videocall #14

Closed FredeHo closed 7 years ago

FredeHo commented 7 years ago

Script error caught: Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found taht matched the signature provided, file:///android_asset/www/plugins/cordova-plugin-bit6/www/bit6.js, 3321

This error is thrown in your demo app and witnessed in our implementation too when trying to videocall (accessing local/remote video sources). Android <7 works fine.

FredeHo commented 7 years ago

Strangly everything is working just fine today (tested on multiple A7 devices). Videocalling without a problem.

FYI: Line 3316 of bit6.js is still elem.src = window.URL.createObjectURL(stream);

Shouldn't it be for good measure elem.src = (window.URL || window.webkitURL).createObjectURL(stream); ?

I'm closing this issue for now, 'cause we are unable to reproduce it anymore.

agol commented 7 years ago

Could it be related to the permissions on Android 7? We are using WebRTC API in Android WebView to access camera. Unfortunately the WebView does not trigger native Android permission requests for camera and mic access. A workaround is to use native code to request the permissions. For example, using this plugin: https://github.com/NeoLSN/cordova-plugin-android-permissions

FredeHo commented 7 years ago

Hi Alexey, no I don't think so. We're already using https://ionicframework.com/docs/native/android-permissions/ which resolves to https://github.com/NeoLSN/cordova-plugin-android-permissions. To be sure I removed all permissions (camera, microphone, etc.) directly and tested videocalling. The result is that for example the local video stream keeps the placeholder image but no crash..