Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dkaiser

macrumors newbie
Original poster
Nov 29, 2017
8
0
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.. anyone know what i am missing?

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()
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.