Kodi Community Forum

Full Version: Two subtitles on pause
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to write addon which loads two subtitle files (top and bottom) when uses hits pause while watching video.

I am stuck with "Addon does not have correct structure". I've seen tutorials and everything seems to be ok but it's not.

Code:
$ uname -a
Linux PC 3.2.0-4-686-pae #1 SMP Debian 3.2.65-1+deb7u1 i686 GNU/Linux
$ xbmc --version
XBMC Media Center 13.2 Debian package version:2:13.2+dfsg1-3~bpo70+1
Copyright (C) 2005-2013 Team XBMC - http://xbmc.org
$ ls plugin.video.two_subs_pause
addon.py  addon.xml  changelog.txt  icon.png  LICENSE.txt
$ zip -r plugin.video.two_subs_pause-0.1.zip plugin.video.two_subs_pause

addon.py
Code:
import xbmc


class MyPlayer(xbmc.Player):
    def __init__(self):
        xbmc.Player.__init__(self)

    def onPlayBackPaused(self):
        xbmc.log('paused')
        # ToDo: show two subtitles files

player = MyPlayer()
addon.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<addon id="plugin.video.two_subs_pause" version="0.1" name="two subtitles pause" provider-name="anonymous">
  <requires></requires>
  <extension point="xbmc.python.pluginsource" library="addon.py">
    <provides>video</provides>
  </extension>
  <extension point="xbmc.addon.metadata">
    <summary>Shows two subtitles on pause</summary>
    <description>Shows two subtitles on pause</description>
    <platform>all</platform>
  </extension>
</addon>

Code:
http://speedy.sh/u4J9F/plugin.video.two-subs-pause-0.1.zip

Can anyone help me? I just want it done because I like to watch and learn vocabulary. I watch videos in foreign language with subtitles and if I need to lookup some word I simply press space (pause) and got my native subs.
Thanks!
changing:
<requires></requires>
to:
<requires><import addon="xbmc.python" version="2.1.0"/> </requires>
might help
this sounds cool!!

Then you can like learn a language!!!
Have you succeeded making this addon? Please share your result if make it!