OTPublisher videoTrack: false crashes the app on Android
EdShel opened this issue · 1 comments
EdShel commented
Bug Report
Current behavior
After upgrading from v0.20.0 to 0.21.2 (the latest version by now) our app started crashing due to a Java exception when disabling video subsystem using the following prop of OTPublisher:
properties={{ videoTrack: false }}
The exception message says
Content hint can only be set after constructing the Publisher and Capturer.
The issue is probably related to this new code
By now, the workaround for us is to check for videoTrack being true before setting video hint:
if (mPublisher.getCapturer() != null && videoTrack) {
mPublisher.getCapturer().setVideoContentHint(Utils.convertVideoContentHint(properties.getString("videoContentHint")));
}
Steps to reproduce
- Clone sample apps Github repository
- Go to BasicVideoChat project
- Inside App.js provide API key, session id, token
- Add properties={{ videoTrack: false }} to OTPublisher. The element should look like this:
<OTPublisher style={{ width: 200, height: 200 }} properties={{ videoTrack: false }} />
- Launch the app on Android
yarn && yarn android
- You'll immediately get crash (see the screenshot below).
Example Project
Reproduced in the sample apps
What is the current bug behavior?
videoTrack property is basically useless now and breaks old code.
What is the expected correct behavior?
The app shouldn't crash when setting videoTrack to false.