# MobileRTCActiveVideoView does not display the video at startup

**URL:** <https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862>\
**Category:** iOS\
**Created:** [October 14, 2021, 9:38am UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862 "2021-10-14T09:38:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [October 14, 2021, 9:38am UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862/1 "2021-10-14T09:38:05Z")

</div>

I am working on an app using custom meeting UI but MobileRTCActiveVideoView does not display the video for the active user at startup, it remains black until another user becomes active (for audio detection).

 ![IMG_0143](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/e/1/e1f852de39885af1d0d80223a059b4e1ce01f627.png)

If the active user at startup has disabled the camera then the user icon placeholder is visible but when the camera is re-enabled then the ActiveVideoView becomes black.

 ![IMG_0144](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/e/b/eb3e9471af33ce53d74df82f4491791044013f03.png)

It started happeing after updating the Zoom meeting SDK from v5.4.54802.0124 to v5.7.6.1076, with the old SDK MobileRTCActiveVideoView works as expected.

 ![IMG_0237.PNG](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/0/9/092225817ea263fc4dc45f041ed7adc2314afd17.jpeg)

I did some test with sample app with custom UI and I see a similar issue in bottom video cells. They remain black at startup.

Meeting SDK version 5.7.6.1076

Device: [e.g. iPhone 6s, Iphone 7]  
OS: [e.g. iOS 14.8]

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [October 15, 2021, 12:44am UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862/2 "2021-10-15T00:44:07Z")

</div>

Hey @criva,

Thanks for using the dev forum!

Where are you setting up the activeVideoView?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [October 15, 2021, 7:33am UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862/3 "2021-10-15T07:33:18Z")

</div>

The app instantiates a CustomMeetingViewController inside the onInitMeetingView of the MobileRTCCustomizedUIMeetingDelegate

```auto
extension SDKStartJoinMeetingPresenter: MobileRTCCustomizedUIMeetingDelegate {
    func onInitMeetingView() {
        self.customMeetingVC = CustomMeetingViewController()
        if let rootVC = self.rootVC, let customMeetingVC = self.customMeetingVC {
            rootVC.addChild(customMeetingVC)
            rootVC.view.addSubview(customMeetingVC.view)
            customMeetingVC.didMove(toParent: rootVC)
            customMeetingVC.view.frame = rootVC.view.bounds
        }
    }
}

```

The CustomMeetingViewController contains an VideoPageViewController: UIPageViewController

```auto
CustomMeetingViewController: UIViewController {

    lazy var baseView: UIView = {
        let _baseView = UIView(frame:self.view.bounds)
        _baseView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        return _baseView
    }()
    lazy var videoPageVC: VideoPageViewController = {
        let _videoPageVC = VideoPageViewController()
        _videoPageVC.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        return _videoPageVC
    }()
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(self.baseView)
        self.addChild(self.videoPageVC)
        self.baseView.addSubview(self.videoPageVC.view)
    }
}

```

and the first page (FirstPageViewController) contains the MobileRTCActiveVideoView.

```auto
FirstPageViewController: UIViewController { 
    lazy var activeVideoView: MobileRTCActiveVideoView = {
        let _activeVideoView = MobileRTCActiveVideoView.init(frame: self.view.bounds)
        _activeVideoView.setVideoAspect(MobileRTCVideoAspect_Original)
        return _activeVideoView
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(self.activeVideoView)
    }
  }

```

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [October 19, 2021, 9:37am UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862/4 "2021-10-19T09:37:13Z")

</div>

@Michael_Condon

As a temporary workaround I added the following code in viewDidLoad

```auto
        let delayTime = DispatchTime.now() + 3.0
        DispatchQueue.main.asyncAfter(deadline: delayTime, execute: {
            if let activeUserId = MobileRTC.shared().getMeetingService()?.activeUserID() {
                self.activeVideoView.stopAttendeeVideo()
                self.activeVideoView.showAttendeeVideo(withUserID: activeUserId)
            }
        })

```

but it is too dirty for the release version.

I hope that you can help me to find a better solution.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [October 20, 2021, 7:11pm UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862/5 "2021-10-20T19:11:07Z")

</div>

Hey @criva,

Can you try moving the code that is inside of your DispatchQueue block into the callback: onSinkMeetingActiveVideo?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![criva](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@criva](https://devforum.zoom.us/u/criva)\
**Post date:** [October 25, 2021, 10:18am UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862/6 "2021-10-25T10:18:03Z")

</div>

@Michael_Condon

I’ve tried to move my code inside the onSinkMeetingActiveVideo callback and It fixes the issue but the onSinkMeetingActiveVideo fires multiple times during the meeting startup.

Do you think that call multiple times stopAttendeeVideo and showAttendeeVideo is a good idea?

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [October 25, 2021, 7:04pm UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862/7 "2021-10-25T19:04:02Z")

</div>

Hey @criva,

The active video view is supposed to automatically handle showing/hiding the active user. I do not think you need to call these methods but rather set up the active video view inside that callback.

Thanks!  
Michael

---

<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:** [November 25, 2021, 5:04am UTC](https://devforum.zoom.us/t/mobilertcactivevideoview-does-not-display-the-video-at-startup/58862/8 "2021-11-25T05:04:18Z")

</div>

Closed on November 25, 2021, 5:04am UTC

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