Closed fbinz closed 1 month ago
Hello @fbinz! Thank you for your effort to make the issue replication easier, however due to increased workload, I find myself with limited time to dedicate to the project at this point.
Yeah, totally understandable! Do you maybe have some pointer, where I could begin to look? Maybe you already have a "hunch" as to where this could be coming from?
Hey @fbinz!
BroadcastSession
class itself. You can try replacing the call to this method with the [listAttachedDevices](https://aws.github.io/amazon-ivs-broadcast-docs/1.12.0/android/com/amazonaws/ivs/broadcast/BroadcastSession.html#listAttachedDevices()) method, as shown in the IVS Broadcast SDK Android Guide:
// awaitDeviceChanges will fire on the main thread after all pending devices
// attachments have been completed
broadcastSession.awaitDeviceChanges(() -> {
for(Device device: session.listAttachedDevices()) {
// Find the camera we attached earlier
if(device.getDescriptor().type == Device.Descriptor.DeviceType.CAMERA) {
LinearLayout previewHolder = findViewById(R.id.previewHolder);
ImagePreviewView preview = ((ImageDevice)device).getPreviewView();
preview.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT));
previewHolder.addView(preview);
}
}
});
We have recently implemented pretty much the same with the iOS wrapper to address this problem.
First off: Thank you for this package! It's really cool to have such a small wrapper around the SDKs provided by AWS.
We've encountered a bug on Android, that seems to be related to mounting/unmounting and the preview video. For us, it manifests when we navigate away from and then back to a broadcast screen. After navigating back to the broadcast screen, the preview video is empty. It can be "reinitialized" by swapping the camera back and forth.
I've created a reproduction repo, so that it's easier for you to reproduce the issue: https://github.com/fbinz/react-native-ivs-broadcast-repro.
Here's a small video showing the behavior: