Notice to addon devs

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
robweber Offline
Posting Freak
Posts: 885
Joined: Sep 2009
Reputation: 27
Post: #46
(2014-02-22 23:13)jmarshall Wrote:  It's not on demand. If you import it then you need to specify it as a dependency regardless of platform.

If it's not needed on one platform but is needed on another then there's a completely different problem to solve.

Could you explain what the "optional" tag is actually doing then? According the wiki: "This will only install the dependency when the add-on actually needs it"

Just trying to figure out when this would actually be useful. Thanks.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,228
Joined: Oct 2003
Reputation: 177
Post: #47
Add-ons are only ever installed either as a required dependency, or as an optional dependency where the existing version is too low, or when the user initiates the install of an add-on.

They're never installed "on demand" or anything like that.

The optional dependency is to specify that the add-on will make use of it if it's there, but won't freak out if it isn't. i.e. it's up to the user to install that optional dependency, rather than the add-on author.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
sphere Offline
Team-Kodi Member
Posts: 1,205
Joined: Jul 2009
Reputation: 50
Location: Germany
Post: #48
(2014-02-24 06:24)jmarshall Wrote:  They're never installed "on demand" or anything like that.

Just want to add that plugin add-ons can indeed be installed on demand, but only for playback.
If plugin A returns a playable URL like "plugin://plugin.video.add-on-b" and "plugin.video.add-on-b" is not installed but available through any installed repository the User will see a dialog like "Plugin B is not installed, do you want to install?"

Of course this also works on playback, not if plugin A tries to import or use any code from plugin B.

My GitHub. My Add-ons:
[Image: IOoywq0.jpg]
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,228
Joined: Oct 2003
Reputation: 177
Post: #49
Yup, that's true - there's specific code for installing plugins, forgot about that.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
robweber Offline
Posting Freak
Posts: 885
Joined: Sep 2009
Reputation: 27
Post: #50
Thanks. I see the difference now, just didn't want to try using it myself one day and not get the results I expected. Sounds like the use of this would really be an edge case in most situations.
find quote
takoi Offline
Fan
Posts: 727
Joined: Oct 2009
Reputation: 10
Location: Norway
Post: #51
(2013-09-19 22:44)Martijn Wrote:  script.module.elementtree

It seems that we are still using the script.module.elementtree however this is no longer needed since python version 2.5 and higher. Since XBMC uses python 2.6 or higher it is safe to use elementtree that has been included in python.

To use it simply include this (for example):
PHP Code:
import xml.etree.ElementTree as ET 

More information can be found here
http://docs.python.org/2/library/xml.etr...ttree.html

On next update it would be appreciated if you could replace the used module with the build in one.
After porting to this module, I have to say: it's not that simple. There's major api differences. I managed to rewrite to a different set of api just fine but there might be feature differences here, I dunno..
find quote
Kuki77 Offline
Junior Member
Posts: 3
Joined: Sep 2014
Reputation: 0
Post: #52
This issue of the standard player for mp4 audio still persists. Sad
find quote
jerimiah797 Offline
Member
Posts: 64
Joined: Mar 2011
Reputation: 2
Post: #53
Really? It worked for me. I am fetching mp4 files that are incorrectly served as audio/mpeg (containing AAC audio) and were thus being handled by the paplayer instead of the dvdplayer. Now I explicitly set the mime type and XBMC uses the correct player when my player instance is set to AUTO. Here's my plugin code, returning a setResolvedUrl:

Code:
import xbmcgui
import xbmcplugin
import cgi
import urllib2
import json

def get_it(args):

  def parse_query(query):
    queries = cgi.parse_qs(query)
    q = {}
    for key, value in queries.items():
        q[key] = value[0]
    return q

  plugin_url = args[0]
  plugin_handle = int(args[1])
  plugin_queries = parse_query(args[2][1:])

  try:
    track = plugin_queries['track']
  except:
    pass

  def __get_data(req, timeout):
    succeed = 0
    while succeed < 1:
      try:
        response = urllib2.urlopen(req, timeout=timeout)
        try:
          results = json.load(response)
          return results
        except:
          return True
      except urllib2.HTTPError, e:
        print "------------------  Bad server response ----------------"
        print e.headers
        print e
        succeed += 1
      except urllib2.URLError, e:
        print 'We failed to reach a server.'
        print 'Reason: ', e.reason
        succeed += 1
    return False


  def get_playable_url(track_id):
    url = "http://localhost:8090/?track=%s" % (track_id)
    req = urllib2.Request(url)
    results = __get_data(req, 10)
    if not results:
      return False
    else:
      return str(results[0]['url'])


  try:
    url = get_playable_url(track)
    item = xbmcgui.ListItem(path=url)
    item.setProperty('mimetype','audio/mp4')
    xbmcplugin.setResolvedUrl(int(args[1]), True, item)
  except:
    pass




(2014-01-19 09:28)rivy Wrote:  @Bstrdsmkr,

I tried:

PHP Code:
item.setProperty('mimetype''audio/mp4')
xbmc.Player().playurlitem 

... without success. Again, I receive a codec error:
Quote:ERROR: CAudioDecoder: Unable to Init Codec ...
find quote
Post Reply