AVKit Player View only works in xcode not in exported app

Hi, can't figure out why AVKit Player View only works inside xcode, and not in the exported app

when i run the exported app it makes hole my viewcontroller blank like nothing is in it

when i run it inside excode everything works..

import Cocoa
import AVKit //Til video og lyd
import AVFoundation //Til video og lyd

class LogonViewController: NSViewController {

    @IBOutlet weak var playerView: AVPlayerView!



        override func viewDidLoad() {
        super.viewDidLoad()

            VIDEO()
    }
    func VIDEO()
    { 
        guard let url = Bundle.main.url(forResource: "v1", withExtension: "mp4") else {
             return
         }  
         let player = AVPlayer(url: url)
         playerView.player = player
         player.play()
         }

}


AVKit Player View only works in xcode not in exported app
 
 
Q