Closed AbhishekSri979 closed 3 months ago
Hi @AbhishekSri979 Pls see the comments https://github.com/aws-samples/amazon-chime-react-native-demo/issues/195#issuecomment-1711360513 It may help you. we have faced the same issue before Thanks
Hi @ashirkhan94
i checked this https://github.com/aws-samples/amazon-chime-react-native-demo/issues/195, and implemented as per comments but i am getting below error, also when i calling setPauseTile and setResumeTile function then nothing happening, so can you suggest me what i missing
Below are the implemented code
For IOS: In MeetingObserver.m file
(void)videoTileDidPauseWithTileState:(VideoTileState * _Nonnull)tileState { // Not implemented for demo purposes [_bridge sendEventWithName:KEventonOnPauseVideoTile body:@{@"tileId":[NSNumber numberWithInt: (int)tileState.tileId],@"attendeeId":[tileState attendeeId], @"isLocal":@(tileState.isLocalTile), @"isScreenShare":@(tileState.isContent),@"pauseState":@(tileState.pauseState)}]; }
(void)videoTileDidResumeWithTileState:(VideoTileState * _Nonnull)tileState { // Not implemented for demo purposes [_bridge sendEventWithName: KEventOnResumeVideoTile body:@{@"tileId":[NSNumber numberWithInt: (int)tileState.tileId], @"attendeeId":[tileState attendeeId], @"isLocal":@(tileState.isLocalTile), @"isScreenShare":@(tileState.isContent), @"pauseState":@(tileState.pauseState)}]; }
In NativeMobileSDKBridge.m RCT_EXPORT_METHOD(setPauseTile:(NSNumber * _Nonnull)tileId) { [meetingSession.audioVideo pauseRemoteVideoTileWithTileId:[tileId integerValue]]; }
RCT_EXPORT_METHOD(setResumeTile:(NSNumber * _Nonnull)tileId) { [meetingSession.audioVideo resumeRemoteVideoTileWithTileId:[tileId integerValue]]; }
For Android: in MeetingObserver.kt override fun onVideoTilePaused(tileState: VideoTileState) { // Not implemented for demo purposes logger.info(TAG, "Received event for VideoTilePaused: $tileState") eventEmitter.sendVideoTileEvent(RN_EVENT_VIDEO_TILE_PAUSED, tileState) } override fun onVideoTileResumed(tileState: VideoTileState) { // Not implemented for demo purposes logger.info(TAG, "Received event for VideoTileResumed: $tileState") eventEmitter.sendVideoTileEvent(RN_EVENT_VIDEO_TILE_RESUME, tileState) }
in NativeMobileSDKBridge.kt @ReactMethod fun setPauseTile(tileId: Int) { logger.info(TAG, "setPauseTile: $tileId") meetingSession?.run { audioVideo.pauseRemoteVideoTile(tileId) } } @ReactMethod fun setResumeTile(tileId: Int) { logger.info(TAG, "setResumeTile: $tileId") meetingSession?.run { audioVideo.resumeRemoteVideoTile(tileId) } }
in recat native side
const onPauseVideotileSubscription = () => getSDKEventEmitter().addListener( "OnPauseVideoTile", async (data) => { console.log('onPauseVideotileSubscription', data); // if (tileState.pauseState == 2) { // console.log("Video was paused due to a poor network connection") // } } );
const onResumeVideotileSubscription = () =>
getSDKEventEmitter().addListener(
"OnResumeVideoTile",
async (data) => {
console.log('onResumeVideotileSubscription', data);
}
);
@ashirkhan94
Also my internet connectivity is fine, so why video tiles is freezing or blank out, if there any other approach to fix this then please suggest me.
Hi @AbhishekSri979
I think you may check the cause of video freeze by checking the value of tileState.pauseState
setPauseTile
You need to Change
Bridge.js
like
export const MobileSDKEvent = {
OnMeetingStart: 'OnMeetingStart',
OnMeetingEnd: 'OnMeetingEnd',
-----------
-----------
OnPauseVideoTile: 'OnPauseVideoTile',
OnResumeVideoTile: 'OnResumeVideoTile',
for Ios
meetingObserver.h
//need to define OnPauseVideoTile and OnResumeVideoTile here like
#define kEventOnMeetingStart @"OnMeetingStart"
#define kEventOnMeetingEnd @"OnMeetingEnd"
.
.
#define KEventonOnPauseVideoTile @"OnPauseVideoTile"
#define KEventOnResumeVideoTile @"OnResumeVideoTile"
in NativeMobileSDKBridge.m
need to add KEventonOnPauseVideoTile
and KEventOnResumeVideoTile
here
- (NSArray<NSString *> *)supportedEvents
{
return
@[
kEventOnMeetingStart,
kEventOnMeetingEnd,
.
.
KEventonOnPauseVideoTile,
KEventOnResumeVideoTile,
.
.
kEventOnError
];
}
For Android
need to change
RNEventEmitter.kt
file like
class RNEventEmitter(private val reactContext: ReactApplicationContext) {
companion object {
// Event types
const val RN_EVENT_ERROR = "OnError"
const val RN_EVENT_MEETING_START = "OnMeetingStart"
const val RN_EVENT_VIDEO_TILE_PAUSED = "OnPauseVideoTile"
const val RN_EVENT_VIDEO_TILE_RESUME = "OnResumeVideoTile"
@ashirkhan94 yes i am already doing this
@AbhishekSri979 For me its working
ok thanks @ashirkhan94, i will check again
@AbhishekSri979
In android MeetingObservers.kt
file
import com.amazonaws.services.chime.RNDemo.RNEventEmitter.Companion.RN_EVENT_VIDEO_TILE_PAUSED
import com.amazonaws.services.chime.RNDemo.RNEventEmitter.Companion.RN_EVENT_VIDEO_TILE_RESUME
need to import above lines for pause and resume events
yes @ashirkhan94 i implemented all above code.
Hi @ashirkhan94
i checked this #195, and implemented as per comments but i am getting below error, also when i calling setPauseTile and setResumeTile function then nothing happening, so can you suggest me what i missing
Below are the implemented code
For IOS: In MeetingObserver.m file
- (void)videoTileDidPauseWithTileState:(VideoTileState * _Nonnull)tileState { // Not implemented for demo purposes [_bridge sendEventWithName:KEventonOnPauseVideoTile body:@{@"tileId":[NSNumber numberWithInt: (int)tileState.tileId],@"attendeeId":[tileState attendeeId], @"isLocal":@(tileState.isLocalTile), @"isScreenShare":@(tileState.isContent),@"pauseState":@(tileState.pauseState)}]; }
- (void)videoTileDidResumeWithTileState:(VideoTileState * _Nonnull)tileState { // Not implemented for demo purposes [_bridge sendEventWithName: KEventOnResumeVideoTile body:@{@"tileId":[NSNumber numberWithInt: (int)tileState.tileId], @"attendeeId":[tileState attendeeId], @"isLocal":@(tileState.isLocalTile), @"isScreenShare":@(tileState.isContent), @"pauseState":@(tileState.pauseState)}]; }
In NativeMobileSDKBridge.m RCT_EXPORT_METHOD(setPauseTile:(NSNumber * _Nonnull)tileId) { [meetingSession.audioVideo pauseRemoteVideoTileWithTileId:[tileId integerValue]]; }
RCT_EXPORT_METHOD(setResumeTile:(NSNumber * _Nonnull)tileId) { [meetingSession.audioVideo resumeRemoteVideoTileWithTileId:[tileId integerValue]]; }
For Android: in MeetingObserver.kt override fun onVideoTilePaused(tileState: VideoTileState) { // Not implemented for demo purposes logger.info(TAG, "Received event for VideoTilePaused: $tileState") eventEmitter.sendVideoTileEvent(RN_EVENT_VIDEO_TILE_PAUSED, tileState) } override fun onVideoTileResumed(tileState: VideoTileState) { // Not implemented for demo purposes logger.info(TAG, "Received event for VideoTileResumed: $tileState") eventEmitter.sendVideoTileEvent(RN_EVENT_VIDEO_TILE_RESUME, tileState) }
in NativeMobileSDKBridge.kt @ReactMethod fun setPauseTile(tileId: Int) { logger.info(TAG, "setPauseTile: $tileId") meetingSession?.run { audioVideo.pauseRemoteVideoTile(tileId) } } @ReactMethod fun setResumeTile(tileId: Int) { logger.info(TAG, "setResumeTile: $tileId") meetingSession?.run { audioVideo.resumeRemoteVideoTile(tileId) } }
in recat native side
const onPauseVideotileSubscription = () => getSDKEventEmitter().addListener( "OnPauseVideoTile", async (data) => { console.log('onPauseVideotileSubscription', data); // if (tileState.pauseState == 2) { // console.log("Video was paused due to a poor network connection") // } } );
const onResumeVideotileSubscription = () => getSDKEventEmitter().addListener( "OnResumeVideoTile", async (data) => { console.log('onResumeVideotileSubscription', data); } );
@AbhishekSri979 Does the error still exist?
Hi @ashirkhan94 i checked this #195, and implemented as per comments but i am getting below error, also when i calling setPauseTile and setResumeTile function then nothing happening, so can you suggest me what i missing
Below are the implemented code For IOS: In MeetingObserver.m file
- (void)videoTileDidPauseWithTileState:(VideoTileState * _Nonnull)tileState { // Not implemented for demo purposes [_bridge sendEventWithName:KEventonOnPauseVideoTile body:@{@"tileId":[NSNumber numberWithInt: (int)tileState.tileId],@"attendeeId":[tileState attendeeId], @"isLocal":@(tileState.isLocalTile), @"isScreenShare":@(tileState.isContent),@"pauseState":@(tileState.pauseState)}]; }
- (void)videoTileDidResumeWithTileState:(VideoTileState * _Nonnull)tileState { // Not implemented for demo purposes [_bridge sendEventWithName: KEventOnResumeVideoTile body:@{@"tileId":[NSNumber numberWithInt: (int)tileState.tileId], @"attendeeId":[tileState attendeeId], @"isLocal":@(tileState.isLocalTile), @"isScreenShare":@(tileState.isContent), @"pauseState":@(tileState.pauseState)}]; }
In NativeMobileSDKBridge.m RCT_EXPORT_METHOD(setPauseTile:(NSNumber _Nonnull)tileId) { [meetingSession.audioVideo pauseRemoteVideoTileWithTileId:[tileId integerValue]]; } RCT_EXPORT_METHOD(setResumeTile:(NSNumber _Nonnull)tileId) { [meetingSession.audioVideo resumeRemoteVideoTileWithTileId:[tileId integerValue]]; } For Android: in MeetingObserver.kt override fun onVideoTilePaused(tileState: VideoTileState) { // Not implemented for demo purposes logger.info(TAG, "Received event for VideoTilePaused: $tileState") eventEmitter.sendVideoTileEvent(RN_EVENT_VIDEO_TILE_PAUSED, tileState) } override fun onVideoTileResumed(tileState: VideoTileState) { // Not implemented for demo purposes logger.info(TAG, "Received event for VideoTileResumed: $tileState") eventEmitter.sendVideoTileEvent(RN_EVENT_VIDEO_TILE_RESUME, tileState) } in NativeMobileSDKBridge.kt @ReactMethod fun setPauseTile(tileId: Int) { logger.info(TAG, "setPauseTile: $tileId") meetingSession?.run { audioVideo.pauseRemoteVideoTile(tileId) } } @ReactMethod fun setResumeTile(tileId: Int) { logger.info(TAG, "setResumeTile: $tileId") meetingSession?.run { audioVideo.resumeRemoteVideoTile(tileId) } } in recat native side const onPauseVideotileSubscription = () => getSDKEventEmitter().addListener( "OnPauseVideoTile", async (data) => { console.log('onPauseVideotileSubscription', data); // if (tileState.pauseState == 2) { // console.log("Video was paused due to a poor network connection") // } } );
const onResumeVideotileSubscription = () => getSDKEventEmitter().addListener( "OnResumeVideoTile", async (data) => { console.log('onResumeVideotileSubscription', data); } );
@AbhishekSri979 Does the error still exist?
hi @ashirkhan94
i checked my code again , and all required code are exist but still not working , listener is not calling and in ios crash is appearing
Hii @ashirkhan94
onPause and onResume listener are calling now.
i am explaining what issue i am facing
can you please suggest me ? whenever i got pauseState value 2, then my video tile getting freeze or blank so at that time what should i do ?
below is the ui for video meeting
i thought after calling setResume method video tile will resume but not working.
whenever i will get pauseState value 2 in any of the video tile then what should i do in that case ?
or is there any way to reduce the video quality ?
Thanks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
useCase: If we join more meeting with more than 2 or 3 devices then video tiles get freeze automatically and sometime video tiles get blank.
can someone please help me, because i got stuck and i didn't find any solution for freezing video.
environment: react-native:"0.71.10" aws-chime-sdk:"0.18.2"