                     videoPlayer.play()
                     let end = CMTime(seconds: start + duration, preferredTimescale: 600)
                     self.observer = videoPlayer.addBoundaryTimeObserver(forTimes: [end as NSValue], queue: nil) { [weak self] in
-                        print("pausing", index)
+                        print("SVideoC pausing", index)
                         videoPlayer.pause()
                         self?.removeObserver()
                     }
                 }
+            }
+            
+            for (_, layer) in layers {
+                view.layer.addSublayer(layer)
             }
         }
     }

        let playerItem = AVPlayerItem(url:videoURL)
        videoPlayer.replaceCurrentItem(with: playerItem)
        
        callback(1.0, nil)
    }
    

    fileprivate var videoLayer:AVPlayerLayer!
    fileprivate var index = 0
    fileprivate var observer:Any?
    fileprivate var layers = [String:CALayer]()
    
    deinit {
        print("SVideoC deinit")
    }

    override func viewDidLoad() {
