     }
 
     @objc private func capturePosterFrame(sender: AnyObject?) {
-        guard let player = playerView.player else { return }
-        guard let asset = player.currentItem?.asset else { return }
-
-        let generator = AVAssetImageGenerator(asset: asset)
-        guard let cgImage = try? generator.copyCGImageAtTime(player.currentTime(), actualTime: nil) else { return }
+        guard let cgImage = try? imageGenerator.copyCGImageAtTime(player.currentTime(), actualTime: nil) else { return }
         let image = NSImage(CGImage: cgImage, size: CGSize(width: CGImageGetWidth(cgImage), height: CGImageGetHeight(cgImage)))
         posterFrameView.image = image
     }
 
     @objc private func createLivePhoto(sender: AnyObject?) {
-        guard let player = playerView.player else { return }
-        guard let asset = player.currentItem?.asset else { return }
         guard let image = posterFrameView.image else { return }
 
         let outputDir = NSURL(fileURLWithPath: NSHomeDirectory()).URLByAppendingPathComponent("Pictures/LoveLiver")

    }

    init!(movieURL: NSURL) {
        super.init(nibName: nil, bundle: nil)
        playerView.player = AVPlayer(URL: movieURL)
    }

    required init?(coder: NSCoder) {

        }

        guard image.TIFFRepresentation?.writeToFile(tmpImagePath, atomically: true) == true else { return }
        guard let session = AVAssetExportSession(asset: playerItem.asset, presetName: AVAssetExportPresetPassthrough) else { return }
        session.outputFileType = "com.apple.quicktime-movie"
        session.outputURL = NSURL(fileURLWithPath: tmpMoviePath)
        session.timeRange = CMTimeRange(start: player.currentTime(), duration: CMTime(value: 3*600, timescale: 600))
