How to find if player stopped because user pressed Stop and not because of error?
#1
Anybody know how to find when user pressed stop on remote, keyboard....
Need to know if player stop was initiated by user and did not stop by error

Thank you
Reply
#2
It's not pretty or 100%, but it'll do for most occasions. You need to subclass xbmc.Player() and play the video through your new class. onPlaybackStopped() will be called when playback is stopped by the user, and onPlaybackEnded() for any other reason
Reply
#3
I already tested onPlaybackStopped() and does not work because it is triggered also when play stopped by error.
What I want to do is to restart player if player stopped by error and stop player if player stopped by user.
Os some streams the player stops allot by itself
Reply
#4
It won't be triggered it there's an error on the server side and the server stops sending the stream as some streams stop like this normally and there's no way for XBMC to know the difference.

One problem in a similar vein that I've run into is when xbmc doesn't receive the first packet of information quickly enough and gives up, logging an "Error creating demuxer." This doesn't return any error to python and looks to the script like playback finished normally. The only workaround I've been able to find is to initialize my player class with known nonsensical values for current play time and total time. Then when the player exits, if they're still the same, I can assume that's what happened
Reply
#5
Some streams stops for no reason the player, the server continues to stream. In vlc, outside the xbmc the stream works perfect without stopping
I tested and when player stop by error it trigger onPlaybackStopped() same as when user pressed stop

I wonder maybe to create a playlist with the stream and use repeatall (didn't tested this but since the error trigger onPlaybackStopped and not onPlaybackEnd probably it will not work also)
Reply

Logout Mark Read Team Forum Stats Members Help
How to find if player stopped because user pressed Stop and not because of error?0