VLCKit on tvOS mediaPlayerStateChanged not fired

This forum is about all development around libVLC.
Fanfwe
New Cone
New Cone
Posts: 7
Joined: 09 Sep 2020 09:26

VLCKit on tvOS mediaPlayerStateChanged not fired

Postby Fanfwe » 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:

Code: Select all

class ViewController: UIViewController, VLCMediaPlayerDelegate {
I then set the delegate to self in my viewDidLoad method:

Code: Select all

override func viewDidLoad() { super.viewDidLoad() mediaPlayer = VLCMediaPlayer() mediaPlayer.delegate = self mediaPlayer.drawable = view }
And finally, I added the mediaPlayerStateChanged method to my ViewController class, with just a debug print:

Code: Select all

public func mediaPlayerStateChanged(aNotification: NSNotification!) { print("### STATE CHANGED ###") }
But it never ever gets called, and I can't figure out why.
Is there something I'm missing here ?

Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests