Hassaan Akbar
Hassaan Akbar

Reputation: 297

initPublisher creates a publisher object but does not initialize camera

I have downloaded the BasicVideoChat of opentok-cordova-samples, changed credentials in config.js but on launching the app shows black screen in publisher div.

var publisher = OT.initPublisher('publisher');

does create a publisher but does not initialize camera and neither asks permission.

cordova-android: ^7.1.4
Android Device: Xiamo A1, Android 9
Node LTS v10.15.1
cordova-plugin-opentok: ^3.4.3
Also tested on emulator Android 7.0

On opentok event logs in the portal, it shows the client connected but no publish event. Subscriber is working fine.

When using BasicVideoChat of opentok-ionic-samples and using debugger to step-over the breakpoint on initPublisher. The app asks camera permissions and publisher is also initialized. But running without breakpoint (or using ionic cordova run android) has the same issue.

I tried reinstalling node but did not work.

Upvotes: 0

Views: 471

Answers (1)

Manik
Manik

Reputation: 1515

TokBox Developer Evangelist here.

I help maintain the Cordova Plugin for OpenTok which powers the Ionic applications such as the opentok-ionic-samples. After digging into the code, it looks like there's a bug because the permissions are only requested when you call the publish method on the Session object. You can find the code where this is happening for Android here.

Thanks for filing the issue on the plugin repo, I'll update the issue and this answer when the fix is released.

Upvotes: 1

Related Questions