Skip to main content
deleted 19 characters in body
Source Link
Forge
  • 6.8k
  • 7
  • 48
  • 65

Try this !!!, definitely works for ! for Swift 2.0Swift 2.0

 let player = AVPlayer(URL: url)
    let playerController = AVPlayerViewController()
    
    playerController.player = player
    self.addChildViewController(playerController)
    self.view.addSubview(playerController.view)
    playerController.view.frame = self.view.frame
    
    player.play()  

Try this !!! definitely works ! for Swift 2.0

 let player = AVPlayer(URL: url)
    let playerController = AVPlayerViewController()
    
    playerController.player = player
    self.addChildViewController(playerController)
    self.view.addSubview(playerController.view)
    playerController.view.frame = self.view.frame
    
    player.play()  

Try this, definitely works for Swift 2.0

 let player = AVPlayer(URL: url)
    let playerController = AVPlayerViewController()
    
    playerController.player = player
    self.addChildViewController(playerController)
    self.view.addSubview(playerController.view)
    playerController.view.frame = self.view.frame
    
    player.play()  
Source Link

Try this !!! definitely works ! for Swift 2.0

 let player = AVPlayer(URL: url)
    let playerController = AVPlayerViewController()
    
    playerController.player = player
    self.addChildViewController(playerController)
    self.view.addSubview(playerController.view)
    playerController.view.frame = self.view.frame
    
    player.play()