How do plugin work?
#1
Are they started from scratch every time the user makes an action or are they started only once?
Reply
#2
Don't understand what you're saying; please elaborate.
Reply
#3
former.
Reply
#4
Services startend only once, Plugins everytime start from the begining, if the Action is triggered
Reply
#5
(2013-07-21, 11:58)olivaar Wrote: Services startend only once, Plugins everytime start from the begining, if the Action is triggered

What are services?
Reply
#6
a breed of ponies.
Reply
#7
(2013-07-22, 12:58)spiff Wrote: a breed of ponies.

Image

What do you mean with services?
Reply
#8
http://wiki.xbmc.org/index.php?title=Add-on_development
Reply
#9
I don't see anything about services.
Reply
#10
(2013-07-23, 02:55)ololoe Wrote: I don't see anything about services.
http://wiki.xbmc.org/index.php?title=HOW...g_services
Reply
#11
Why are they needed?
Reply
#12
(2013-07-23, 19:59)ololoe Wrote: Why are they needed?
They are running in the background all the time and are started with xbmc. Normal scripts are executed by the user when needed.
For example, you need service addons to react on specific player events (play/pause/stop).
Reply
#13
So is it possible to make an addon that catches all play events and logs vide urls?
Reply
#14
(2013-07-23, 21:02)ololoe Wrote: So is it possible to make an addon that catches all play events and logs vide urls?
Sure! Its not very complicated. I modified a service addon for you (title and url are logged), you only have to change the logfile path:
Code:
import xbmc

class PlayerEvents(xbmc.Player):
    
    def onPlayBackStarted(self):
    
        xbmc.sleep(1000)
        logFile = "D:\\urls.log"
        title = xbmc.getInfoLabel('VideoPlayer.Title')
        url = xbmc.Player().getPlayingFile()
        fh = open(logFile, 'a')
        fh.write(title+" - "+url+"\n")
        fh.close()
        
player=PlayerEvents()
while (not xbmc.abortRequested):
  xbmc.sleep(100)

Download full addon as zip
Reply
#15
That works Smile Is there a way to get youtube video page url and the name of addon which is playing video?
Reply

Logout Mark Read Team Forum Stats Members Help
How do plugin work?0