Kodi player picture support ?
#1
I have an addon which previously played pictures via Kodi.  I looked at the documentation and the ListItem type says pictures is supported and it used to work.  Here's my listitem code:

                elif mediaClass_text == 'pictures':
                    li.addContextMenuItems([ (menuitem1, 'Container.Refresh'), (menuitem2, 'Action(ParentDir)') ])                    
                    info = {
                        'title': title,
                    }
                    li.setInfo(mediaClass_text, info)

              xbmcplugin.addDirectoryItem(handle=addon_handle, url=itemurl, listitem=li, isFolder=False)

I am seeing in the logs when I click on a picture listitem:

2022-01-31 09:43:14.358 T:45596 WARNING: Playlist Player: ListItem type must be audio or video, use ListItem:ConfusedetInfo to specify!

Has picture support been deprecated or is there something else now I need to do to display the pictures ?


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#2
So I started looking at another option where I could run the:  xbmc.executebuiltin('ShowPicture(%s)'%(itemurl))  command which works.  I looked at the SlideShow option but that seems to be limited to local files and not a listing of pictures each with their own URL.  I've got some very basic functionality working and it is showing pictures with a delay in between but I'd like to send an escape after the last picture to stop displaying the last picture.  I've tried using the SendClick function but it isn't working. 

Here's the code snippet I am testing:
python:
if picnotify < 3:
xbmc.executebuiltin('ShowPicture(%s)'%(itemurl))
xbmc.sleep(3000)
xbmc.executebuiltin('SendClick(esc)')
xbmc.log('I am here first. ' + str(picnotify), xbmc.LOGNOTICE)
picnotify += 1
if picnotify == 3:
xbmc.log('I am here. ' + str(picnotify), xbmc.LOGNOTICE)
xbmc.executebuiltin('SendClick(esc)')

In this example there is a list of 3 URLs.  I've confirmed the loop is iteating and I see all 3 pictures but the Sendclick isn't sending the escape after the last picture.  I looked at the keytable.cpp file and tried all variations of escape but none worked.  Am I looking in the wrong direction here and maybe should be trying a JSON RPC approach to send an escape key ?


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#3
I was able to get it working with this:

xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Input.ExecuteAction","params": {"action": "back"},"id":1}')

I'd still like to better understand if native listitem pictures support has or is being dropped before I end up writing my own slide show viewer.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#4
I am hoping someone from the Kodi team can answer the original post in this thread regarding Kodi no longer accepting 'pictures' as a valid media type for a listitem ?

                elif mediaClass_text == 'pictures':
                    li.addContextMenuItems([ (menuitem1, 'Container.Refresh'), (menuitem2, 'Action(ParentDir)') ])                    
                    info = {
                        'title': title,
                    }
                    li.setInfo(mediaClass_text, info)

Kodi gives this error on both Kodi 18.9 and 19.3:

2022-01-31 09:43:14.358 T:45596 WARNING: Playlist Player: ListItem type must be audio or video, use ListItem:etInfo to specify!

The Kodi development page says it should still work.  It did at one time.  I found this thread regarding displaying pictures and the media type is set to 'image' .  I tried that too and get the same error.



Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#5
it should still work. i tested one of the picture plugins we have in our repo and that one works fine.

if you can post a link were i can download your addon, i can check the code to see if i can spot an issue with it.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
(2022-02-08, 21:37)ronie Wrote: it should still work. i tested one of the picture plugins we have in our repo and that one works fine.

if you can post a link were i can download your addon, i can check the code to see if i can spot an issue with it.

Thanks.  I posted the code here .  Focus on lines 803-824 .  I've commented out lines 811-818.  This is a workaround I created until I can figure it out.  This code did work until sometime recently.  it's been awhile since I tried picture hosting.  My workaround works, which calls a JSON RPC Player.Open method and then I pass it the URL of the pictures. 



Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#7
ok, i see in the addon.xml file your addon provides: video audio image.
without checking any of your code yet, i'm guessing you are running your addon from the 'Video add-ons' section...

could you test if the picture slideshow works ok if you start your addon from the 'Picture add-ons' section?
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
(2022-02-09, 00:22)ronie Wrote: ok, i see in the addon.xml file your addon provides: video audio image.
without checking any of your code yet, i'm guessing you are running your addon from the 'Video add-ons' section...

could you test if the picture slideshow works ok if you start your addon from the 'Picture add-ons' section?

That was exactly it.  I hadn't tested pictures in so long I didn't realize I needed to run the addon from pictures.  I was running it from video and the uPNP server allows the user to browse all media types, audio, video and pictures.  Is there a way to have it change modes to the Pictures add-on if someone launches it from the video addon section and then tries to browse pictures ?  Or must they go all of the way out and back in from Video to Picture Addons ?

If not, maybe there is another approach I have been trying to get working, calling a RunScript from a lisitem.  So instead of clicking on the listitem and having the lisitem URL to the picture attempt to display, have it run a script.  You helped me previously with an extension point in the addon.xml file for context menu launching of scripts and that has been working great.   You can see examples of this in lines 763-781 of the link above.  Since I've already written code which can display pictures from anywhere in the addon, it would be as simple as calling that code with the RunScript approach but I can't find a good example of how to do that with a listitem. 


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#9
(2022-02-09, 01:14)jbinkley60 Wrote:
(2022-02-09, 00:22)ronie Wrote: ok, i see in the addon.xml file your addon provides: video audio image.
without checking any of your code yet, i'm guessing you are running your addon from the 'Video add-ons' section...

could you test if the picture slideshow works ok if you start your addon from the 'Picture add-ons' section?

That was exactly it.  I hadn't tested pictures in so long I didn't realize I needed to run the addon from pictures.  I was running it from video and the uPNP server allows the user to browse all media types, audio, video and pictures.  Is there a way to have it change modes to the Pictures add-on if someone launches it from the video addon section and then tries to browse pictures ?  Or must they go all of the way out and back in from Video to Picture Addons ?

If not, maybe there is another approach I have been trying to get working, calling a RunScript from a lisitem.  So instead of clicking on the listitem and having the lisitem URL to the picture attempt to display, have it run a script.  You helped me previously with an extension point in the addon.xml file for context menu launching of scripts and that has been working great.   You can see examples of this in lines 763-781 of the link above.  Since I've already written code which can display pictures from anywhere in the addon, it would be as simple as calling that code with the RunScript approach but I can't find a good example of how to do that with a listitem. 


Thanks,

Jeff
@ronie 

I was able to resolve what I wanted and I can now launch my picture viewing script via a listitem regardless of whether the addon is started as Pictures, Music or Videos.  I basically added a new mode to the addon, which calls the picture viewer functions and calls the new mode by setting the listitem URL.  I was hoping not to add another mode but it ended up being pretty simple. 

Here's the code highlights:

addon_path = xbmcaddon.Addon().getAddonInfo("path")

def build_url(query):
    return base_url + '?' + urllib.urlencode(query)

def buildlistitems function .....

itemurl = build_url({'mode': 'picture', 'itemurl': itemurl})
if validf == 1:                              #  Add valid listitem
    xbmcplugin.addDirectoryItem(handle=addon_handle, url=itemurl, listitem=li, isFolder=False)


Additional mode parsing:

elif mode[0] == 'picture':
    url = args.get('itemurl', '')
    showSingle(url)


showSingle then displays the picture with an RPC call:

 itemurl = picURL(url[0])
 json_query = xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Player.Open",        \
 "params":{"item":{"file":%s }},"id":1}' % (itemurl)) 


It works perfectly.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi player picture support ?0