Wrong states in VLCMediaPlayerDelegate method !!

iOS, iPad, iPhone, tvOS specific usage questions
huiZhang
Blank Cone
Blank Cone
Posts: 24
Joined: 11 May 2015 13:12

Wrong states in VLCMediaPlayerDelegate method !!

Postby huiZhang » 17 Aug 2015 10:31

Hi,
I found there are something wrong in method - (void)mediaPlayerStateChanged:(NSNotification *)aNotification of delegate VLCMediaPlayerDelegate;
i used VLCMediaPlayerState currentState = mediaPlayer.state to get the state, when mediaPlayerStateChanged called, but the result is always VLCMediaPlayerStateBuffering, only changed when the video played complete it got VLCMediaPlayerStateStopped, or i paused the video then it got VLCMediaPlayerStatePaused, and then it got VLCMediaPlayerStatePlaying when i play the video again.
isn't it got VLCMediaPlayerStateBuffering when i open video ,then got VLCMediaPlayerStatePlaying when the player is playing ? why it is always VLCMediaPlayerStateBuffering even video is begin play? and if i am wrong, how to get the correct state?
Thank you for your help !
2015-08-17 16:19:35.479 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering <----------- begin play video
2015-08-17 16:19:35.663 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:35.686 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:37.110 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:38.026 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:38.085 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:38.100 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:42.769 ELearningQSXT[4793:240305] VLCMediaPlayerStatePaused <----------- when i pause the video
2015-08-17 16:19:44.572 ELearningQSXT[4793:240305] VLCMediaPlayerStatePlaying <----------- when i rePlay the video
2015-08-17 16:19:47.169 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:48.090 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:48.102 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:48.151 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:19:49.069 ELearningQSXT[4793:240305] VLCMediaPlayerStateBuffering
2015-08-17 16:20:08.604 ELearningQSXT[4793:240305] VLCMediaPlayerStateStopped <----------- video end

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: Wrong states in VLCMediaPlayerDelegate method !!

Postby fkuehne » 18 Aug 2015 20:41

It is falling back to buffering if it needs to re-buffer after playback started because your input media isn't provided fast enough, which is typical for network connections.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

huiZhang
Blank Cone
Blank Cone
Posts: 24
Joined: 11 May 2015 13:12

Re: Wrong states in VLCMediaPlayerDelegate method !!

Postby huiZhang » 24 Aug 2015 06:59

It is falling back to buffering if it needs to re-buffer after playback started because your input media isn't provided fast enough, which is typical for network connections.
Thanks , but how can i check the correct state, i need to show some alert words when player is buffering and hide after buffering end.

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: Wrong states in VLCMediaPlayerDelegate method !!

Postby fkuehne » 24 Aug 2015 10:27

There is no BufferingEnd event at this point, even though that might be useful indeed. If you don't receive a new "buffering" event within half a second, it is safe to assume that VLC is not buffering actively.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

huiZhang
Blank Cone
Blank Cone
Posts: 24
Joined: 11 May 2015 13:12

Re: Wrong states in VLCMediaPlayerDelegate method !!

Postby huiZhang » 25 Aug 2015 09:06

There is no BufferingEnd event at this point, even though that might be useful indeed. If you don't receive a new "buffering" event within half a second, it is safe to assume that VLC is not buffering actively.
:) Ok ,Thanks for your help!


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 4 guests