       omidSession.mainAdView = webView
       omidAdEvents = try OMIDDailymotionAdEvents(adSession: omidSession)
       omidMediaEvents = try OMIDDailymotionMediaEvents(adSession: omidSession)
-      try addOMIDFriendlyObstructions(toOmidSession: omidSession)
+      try addFriendlyObstructions(toOmidSession: omidSession, omidFriendlyObstructions)
+      
       self.omidSession = omidSession
     } catch let error {
       print(error.localizedDescription)
     }
   }
   
-  func addOMIDFriendlyObstructions(toOmidSession omidSession:OMIDDailymotionAdSession) throws {
-    guard let  omidFriendlyObstructions = omidFriendlyObstructions else {
-      return
-    }
+  func removeFriendlyObstructions(fromOmidSession omidSession:OMIDDailymotionAdSession,_ friendlyObstruction: UIView) {
+    
+    omidSession.removeFriendlyObstruction(friendlyObstruction)
+  }
+  
+  func addFriendlyObstructions(toOmidSession omidSession:OMIDDailymotionAdSession,_ omidFriendlyObstructions: [OMIDFriendlyObstruction]) throws {
     
     for friendlyObstruction in omidFriendlyObstructions {
-      try omidSession.addFriendlyObstruction(friendlyObstruction.view, purpose: friendlyObstruction.obstructionType, detailedReason: friendlyObstruction.reason)
+      if let view = friendlyObstruction.view {
+        try omidSession.addFriendlyObstruction(view, purpose: friendlyObstruction.obstructionType, detailedReason: friendlyObstruction.reason)
+      }
     }
   }
 

    webView.navigationDelegate = self
  }
  
  public func updateOMIDFriendlyObstructions(omidFriendlyObstructions: [OMIDFriendlyObstruction]) {
    self.omidFriendlyObstructions = omidFriendlyObstructions
  }
  
  //We need this since sometimes the system sets the AVAudioSession to inactive when the app enter in background.

}

public struct OMIDFriendlyObstruction {
  
  public weak var view: UIView?
  public var obstructionType: OMIDFriendlyObstructionType
  public var reason: String?
  
  public init(view: UIView, obstructionType: OMIDFriendlyObstructionType, reason: String? = nil) {
    self.view = view
    self.obstructionType = obstructionType
    self.reason = reason
  }
}

private struct EmbedderProperties: Codable {
