VLCKit on tvOS mediaPlayerStateChanged not fired
Posted: 09 Sep 2020 09:42
Hello,
I am messing with a very basic test app for Apple TV that uses VLCKit.
It has a single view that shows a VLC-based player in fullscreen, so very much similar to the SimplePlayback example from VLCKit.
I need to know when the player stops (because the video ends, for example). I have therefore added the VLCMediaPlayerDelegate protocol to my ViewController class:
I then set the delegate to self in my viewDidLoad method:
And finally, I added the mediaPlayerStateChanged method to my ViewController class, with just a debug print:
But it never ever gets called, and I can't figure out why.
Is there something I'm missing here ?
I am messing with a very basic test app for Apple TV that uses VLCKit.
It has a single view that shows a VLC-based player in fullscreen, so very much similar to the SimplePlayback example from VLCKit.
I need to know when the player stops (because the video ends, for example). I have therefore added the VLCMediaPlayerDelegate protocol to my ViewController class:
Code: Select all
class ViewController: UIViewController, VLCMediaPlayerDelegate {
Code: Select all
override func viewDidLoad() {
super.viewDidLoad()
mediaPlayer = VLCMediaPlayer()
mediaPlayer.delegate = self
mediaPlayer.drawable = view
}
Code: Select all
public func mediaPlayerStateChanged(aNotification: NSNotification!)
{
print("### STATE CHANGED ###")
}
Is there something I'm missing here ?