Commit 383146f3 authored by Rune Botten's avatar Rune Botten Committed by Pierre d'Herbemont

macosx/framework: Register VLCMediaPlayer for opening and buffering events

Signed-off-by: default avatarPierre d'Herbemont <pdherbemont@free.fr>
parent 81717b48
...@@ -108,6 +108,10 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void * ...@@ -108,6 +108,10 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
newState = VLCMediaPlayerStateStopped; newState = VLCMediaPlayerStateStopped;
else if( event->type == libvlc_MediaPlayerEncounteredError ) else if( event->type == libvlc_MediaPlayerEncounteredError )
newState = VLCMediaPlayerStateError; newState = VLCMediaPlayerStateError;
else if( event->type == libvlc_MediaPlayerBuffering )
newState = VLCMediaPlayerStateBuffering;
else if( event->type == libvlc_MediaPlayerOpening )
newState = VLCMediaPlayerStateOpening;
else else
{ {
NSLog(@"%s: Unknown event", __FUNCTION__); NSLog(@"%s: Unknown event", __FUNCTION__);
...@@ -737,10 +741,13 @@ static const VLCMediaPlayerState libvlc_to_local_state[] = ...@@ -737,10 +741,13 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
libvlc_event_attach(p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self); libvlc_event_attach(p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self);
libvlc_event_attach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self); libvlc_event_attach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self);
libvlc_event_attach(p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self); libvlc_event_attach(p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self);
libvlc_event_attach(p_em, libvlc_MediaPlayerOpening, HandleMediaInstanceStateChanged, self);
libvlc_event_attach(p_em, libvlc_MediaPlayerBuffering, HandleMediaInstanceStateChanged, self);
/* FIXME: We may want to turn that off when none is interested by that */ /* FIXME: We may want to turn that off when none is interested by that */
libvlc_event_attach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self); libvlc_event_attach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self);
libvlc_event_attach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self); libvlc_event_attach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self);
libvlc_event_attach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self); libvlc_event_attach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self);
} }
- (void)unregisterObservers - (void)unregisterObservers
...@@ -750,6 +757,9 @@ static const VLCMediaPlayerState libvlc_to_local_state[] = ...@@ -750,6 +757,9 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
libvlc_event_detach(p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self); libvlc_event_detach(p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self); libvlc_event_detach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self); libvlc_event_detach(p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerOpening, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerBuffering, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self); libvlc_event_detach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self); libvlc_event_detach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self); libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment