   }}
 
 class ViewController: UIViewController, WKNavigationDelegate {
-  var startTime = DispatchTime.now()
+  var startTime = Date().timeIntervalSinceReferenceDate
   var webView: WKWebView?
   var clientSocket:Socket?
   var videoCapture:ASScreenRecorder?
+  var videoTimer:Timer?
   var videoUrl: URL?
   var buffer_in = ""
   var hasOrange = false

    UIScreen.main.brightness = 0.0
    closeWebView()
    self.view.backgroundColor = UIColor(red: 222.0/255.0, green: 100.0/255.0, blue: 13.0/255.0, alpha: 1.0)
    startTime = DispatchTime.now()
    webView = WKWebView()
    webView!.frame = self.view.bounds
    self.view.addSubview(webView!)

  }

  func timestamp() -> Double {
    let now = Date().timeIntervalSinceReferenceDate
    let elapsed = Double(round((now - startTime) * 1_000_000) / 1_000_000)
    return elapsed
  }

