         allowOMSDK = false
       }
     }
-
+    
+    NotificationCenter.default.addObserver(self, selector: #selector(self.willEnterInForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
+    setAudioSession()
+    
     if allowIDFA {
       deviceIdentifier = advertisingIdentifier()
     }
+    
     if parameters.contains(where: { $0.key == DMPlayerViewController.loggerParameterKey }) {
       loggerEnabled = true
     }

    }

    self.loadWebView(parameters: parameters, baseUrl: baseUrl, accessToken: accessToken, cookies: cookiesToLoad, allowPiP: allowPiP)
  }
  
  private func newWebView(cookies: [HTTPCookie]?, allowPiP: Bool = true) -> WKWebView {

import OMSDK_Dailymotion
import UIKit
import WebKit
import AVKit

public protocol DMPlayerViewControllerDelegate: AnyObject {
  
