Question: About the VLCEventManager class
Is it possible to implement the process without using VLCEventManager?
for example https://code.videolan.org/videolan/VLCKit/-/blob/master/Sources/VLCMedia.m#L161
static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
{
@autoreleasepool {
[[VLCEventManager sharedManager] callOnMainThreadObject:(__bridge id)(self)
withMethod:@selector(metaChanged:)
withArgumentAsObject:[VLCMedia metaTypeToString:event->u.media_meta_changed.meta_type]];
}
}
↓
static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
{
__block libvlc_meta_t meta_type = event->u.media_meta_changed.meta_type;
VLCMedia *media = (__bridge VLCMedia *)self;
__weak typeof(media) weakMedia = media;
dispatch_async(dispatch_get_main_queue(), ^{
__strong typeof(weakMedia) strongMedia = weakMedia;
if (!strongMedia) return;
[strongMedia metaChanged: meta_type];
});
}
Is it possible to implement it like this?
I also want to know what happens if I don't use VLCEventManager.
best regards.