     var fullAudioDataLength: Int = 0;
     
     var mediaLoader: MediaLoader?;
-    var activityIndicator: UIActivityIndicatorView?
     var hasPushedViewController: Bool = false;
     var ignoreNextDelegateCall: Bool = false;
     

            };
        }
    }
}

        let player = AVPlayer(url: urlToLoad);
        self.player = player;
        self.player?.currentItem?.addObserver(self, forKeyPath: #keyPath(AVPlayerItem.status), options: [.old, .new], context: nil)
        // even though we are not going to do anything with the delegate, it must be set so we can later export the video if the user wants
        (self.player?.currentItem?.asset as? AVURLAsset)?.resourceLoader.setDelegate(self, queue: .main)
        
        player.addObserver(self, forKeyPath: "timeControlStatus", options: [.old, .new], context: nil)
        player.automaticallyWaitsToMinimizeStalling = true;

        let playerViewController = AVPlayerViewController();
        self.playerViewController = playerViewController;
        self.playerViewController?.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Save", style: .plain, target: self, action: #selector(saveVideo))
        
        self.playerViewController?.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Done", style: .plain, target: self, action: #selector(dismiss))
        playerViewController.player = self.player;
        playerViewController.view.autoresizingMask = [.flexibleHeight, .flexibleWidth];
        playerViewController.addObserver(self, forKeyPath: "videoBounds", options: [.old, .new], context: nil);

        self.rootViewController.pushViewController(playerViewController, animated: false);
        self.navigationControllerObserver.observePopTransition(of: playerViewController, delegate: self);
        self.hasPushedViewController = true;
        player.play();
    }
    
    override public func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
        if keyPath == #keyPath(AVPlayerItem.status) {
            let status: AVPlayerItem.Status
            if let statusNumber = change?[.newKey] as? NSNumber {
                status = AVPlayerItem.Status(rawValue: statusNumber.intValue)!
