On my watch I have 2 buttons, IBAction playMovie and stopMovie. I have the AVViewController in my iPhone, and movie.mp4 in my phone Images assets. How can I trigger to start and end the movie on AVViewController on the phone target, from the watch button?
I tried player.play() on my watch controller, and this code on the iPhone view controller, but it brings error 'use of unresolved identifier' player on the watch code. Or i call function playmovie() it brings red flag error 'expected declaration'.
iPhone code: func playmovie(){
let videoURL = NSURL(fileURLWithPath:NSBundle.mainBundle().pathForResource("video1bunny", ofType:"mp4")!)
let player = AVPlayer(URL: videoURL)
let playerViewController = AVPlayerViewController()
playerViewController.player = player
presentViewController(playerViewController, animated: true) { () -> Void in
player.play()
}