# Callback onMyVideoStateChange not triggering after dismissing created view controller

**URL:** <https://devforum.zoom.us/t/callback-onmyvideostatechange-not-triggering-after-dismissing-created-view-controller/28119>\
**Category:** iOS\
**Created:** [August 25, 2020, 3:13pm UTC](https://devforum.zoom.us/t/callback-onmyvideostatechange-not-triggering-after-dismissing-created-view-controller/28119 "2020-08-25T15:13:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joao.moraes](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/joao.moraes/32/13917_2.png) [@joao.moraes](https://devforum.zoom.us/u/joao.moraes)\
**Post date:** [August 25, 2020, 3:13pm UTC](https://devforum.zoom.us/t/callback-onmyvideostatechange-not-triggering-after-dismissing-created-view-controller/28119/1 "2020-08-25T15:13:54Z")

</div>

**Description**  
I’m using the custom meeting UI and created a new `UIViewController` to be presented. When that new controller is dismissed, the `onMyVideoStateChange` callback is not triggered anymore (when the user taps the video button) and thus the video icon and the user thumbnail doesn’t change.

**SDK Version**  
v5.0.24433.0616

**To Reproduce**  
Steps to reproduce the behavior:

1. Create a new `UIViewController`
2. Present it on top of the topViewController (with `.present` method):

```auto
let nav = UINavigationController.init(rootViewController: self) // self because it's a method inside the created view controller
nav.modalPresentationStyle = .fullScreen
topViewController.present(nav, animated: true)

```

3. Create a method to dismiss this view controller: `dismiss(animated: true)`
4. Now, enter the room
5. Tap the video button: it’s working
6. Enter that newly created view controller
7. Dismiss (go back)
8. Tap the video button: it’s not working anymore

**Screenshots**

- When user tapped the video button, **before** entering the new view controller:  

- When user tapped the video button, **after** dismissing the new view controller:  

**Smartphone**

- Device: iPhone 5s
- OS: iOS 12.4.8

---

<div class="post-metadata">

**Author:** ![joao.moraes](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/joao.moraes/32/13917_2.png) [@joao.moraes](https://devforum.zoom.us/u/joao.moraes)\
**Post date:** [August 25, 2020, 5:19pm UTC](https://devforum.zoom.us/t/callback-onmyvideostatechange-not-triggering-after-dismissing-created-view-controller/28119/2 "2020-08-25T17:19:33Z")

</div>

I found the solution. I was mistakenly setting my `UIViewController` as the delegate of `MobileRTCMeetingServiceDelegate`, without actually implementing anything of that protocol:

```auto
class MyViewController: UIViewController, MobileRTCMeetingServiceDelegate {
  override func viewDidLoad() {
    super.viewDidLoad()
    MobileRTC.shared().getMeetingService()?.delegate = self
  }
}

```

After removing `MobileRTC.shared().getMeetingService()?.delegate = self` and `MobileRTCMeetingServiceDelegate`, it worked again.

---

<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:** [August 25, 2020, 5:22pm UTC](https://devforum.zoom.us/t/callback-onmyvideostatechange-not-triggering-after-dismissing-created-view-controller/28119/3 "2020-08-25T17:22:26Z")

</div>

Hey @joao.moraes,

It’s nice to hear from you again!  
I am glad you got this working 🙂

Let us know if you have any other issues  
Michael
