# Black Screen when receive screen sharing

**URL:** <https://devforum.zoom.us/t/black-screen-when-receive-screen-sharing/64126>\
**Category:** iOS\
**Created:** [February 10, 2022, 8:26am UTC](https://devforum.zoom.us/t/black-screen-when-receive-screen-sharing/64126 "2022-02-10T08:26:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bizupssc](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@bizupssc](https://devforum.zoom.us/u/bizupssc)\
**Post date:** [February 10, 2022, 8:26am UTC](https://devforum.zoom.us/t/black-screen-when-receive-screen-sharing/64126/1 "2022-02-10T08:26:26Z")

</div>

**Description**  
Hi Zoom. !  
When Host start share their screen, I (Attendee & Participant) have got black screen on my custom application.  
I have the same code from the example.

```auto
BOOL sharing = (0 != userID);
    if (sharing)
    {
// self.topPanelView.shrinkBtn.hidden = YES;
        MobileRTCMeetingService *ms = [[MobileRTC sharedRTC] getMeetingService];
        //Local Side Share
        if ([ms isSameUser:[ms myselfUserID] compareTo:userID])
        {
            [self.customMeetingVC showLocalShareView];
        }
        //Remote Side Share
        else
        {
            self.customMeetingVC.remoteShareVC.activeShareID = userID;
            [self.customMeetingVC showRemoteShareView];
        }
    }
    else
    {
// self.topPanelView.shrinkBtn.hidden = NO;
        [self.customMeetingVC hideAnnotationView];
        [self.customMeetingVC showVideoView];
       
    }

```

```auto
- ( **void** )showRemoteShareView

{

NSLog(@"=>>>>> showRemoteShareView");

[**self** removeAllSubView];

[**self** showSubView: **self**.remoteShareVC];

[**self** showAnnotationView];

}

```

**Which iOS Meeting SDK version?**  
v5.9.3.2512

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Host start meeting’
2. Host tap on start video and then stop video
3. Host tap on start share screen.
4. See black screen on my app

**Smartphone (please complete the following information):**

- IOS deviece

**Additional context**  
The problem occur when host start and stop camera before share their screen.

Ps. `I'm not implement share screen in my application. I just want to receive shared screen by host.`

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [February 10, 2022, 6:40pm UTC](https://devforum.zoom.us/t/black-screen-when-receive-screen-sharing/64126/2 "2022-02-10T18:40:54Z")

</div>

Hi @bizupssc,

Can you please provide a code snippet showing how you are setting up the share view in your app? The code snippet you’ve provided is only using a `showRemoteShareView` method which is not part of the Meeting SDK.

Thanks!

---

<div class="post-metadata">

**Author:** ![bizupssc](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@bizupssc](https://devforum.zoom.us/u/bizupssc)\
**Post date:** [February 11, 2022, 1:37am UTC](https://devforum.zoom.us/t/black-screen-when-receive-screen-sharing/64126/3 "2022-02-11T01:37:07Z")

</div>

Thanks for reply 🙂  
90% of my code is from your example.  
Here a code of my ShareView

```auto

#import "RemoteShareViewController.h"

#import "CustomRemoteControl.h"

**@interface** RemoteShareViewController ()

**@property** ( **strong** , **nonatomic** ) CustomRemoteControl *remoteControl;

**@end**

**@implementation** RemoteShareViewController

- ( **void** )viewDidLoad {

[**super** viewDidLoad];

// Do any additional setup after loading the view.

**self**.view.backgroundColor = [UIColor clearColor];

[**self**.view addSubview: **self**.shareView];

[**self**.remoteControl setupRemoteControl: **self**.shareView];

}

- ( **void** )didReceiveMemoryWarning {

[**super** didReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}

- ( **void** )dealloc

{

**self**.shareView = **nil** ;

**self**.remoteControl = **nil** ;

}

- ( **void** )viewDidLayoutSubviews

{

[**super** viewDidLayoutSubviews];

**self**.shareView.frame = **self**.view.bounds;

}

- ( **void** )viewDidAppear:( **BOOL** )animated

{

[**super** viewDidAppear:animated];

[**self** updateShareView];

}

- ( **void** )viewDidDisappear:( **BOOL** )animated

{

[**super** viewWillDisappear:animated];

[**self**.shareView stopActiveShare];

}

#pragma mark **- MobileRTCVideoView**

- (MobileRTCActiveShareView *)shareView

{

**if** (!_shareView)

{

_shareView = [[MobileRTCActiveShareView alloc] initWithFrame: **self**.view.bounds];

}

**return** _shareView;

}

- ( **void** )updateShareView

{

**if** (0 != **self**.activeShareID)

{

[**self**.shareView showActiveShareWithUserID: **self**.activeShareID];

}

**else**

{

[**self**.shareView stopActiveShare];

}

}

#pragma mark **- CustomRemoteControl**

- (CustomRemoteControl *)remoteControl

{

**if** (!_remoteControl)

{

_remoteControl = [[CustomRemoteControl alloc]init];

}

**return** _remoteControl;

}

**@end**

```

And then in CustomMeetingViewController

```auto
- (RemoteShareViewController*)remoteShareVC
{
    if (!_remoteShareVC)
    {
        _remoteShareVC = [[RemoteShareViewController alloc] init];
        _remoteShareVC.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onViewOnClick)];
        [_remoteShareVC.shareView addGestureRecognizer:tapGesture];
    }
    return _remoteShareVC;
}

```

---

<div class="post-metadata">

**Author:** ![bizupssc](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@bizupssc](https://devforum.zoom.us/u/bizupssc)\
**Post date:** [February 12, 2022, 6:30am UTC](https://devforum.zoom.us/t/black-screen-when-receive-screen-sharing/64126/4 "2022-02-12T06:30:58Z")

</div>

@jon.zoom Any update?

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [February 22, 2022, 7:08pm UTC](https://devforum.zoom.us/t/black-screen-when-receive-screen-sharing/64126/5 "2022-02-22T19:08:55Z")

</div>

Hi @bizupssc,

If you are mostly using the same code as the sample app, can you please verify whether or not you are able to reproduce using an unmodified version of the sample app?

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [March 25, 2022, 5:09am UTC](https://devforum.zoom.us/t/black-screen-when-receive-screen-sharing/64126/6 "2022-03-25T05:09:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
