How can I prevent playlist mode in Kodi?
#1
Hi,

I'm creating a list of playable items, but I don't want Kodi to consider them as a playlist.
Since when one item finishes playing, it immediately starts playing the next item in the list, and I'm not interested in such behavior.
I want when an item finishes playing to return to the list.

This is how I creating the list items:
python:
    try:
        liz = xbmcgui.ListItem(label = name, label2 = name)
        liz.setArt({'thumb' : iconimage, 'poster': iconimage, 'fanart': iconimage, 'icon': iconimage})
    except:
        liz = xbmcgui.ListItem(label = name, label2 = name, thumbnailImage = iconimage, iconImage = iconimage)
    liz.setInfo(type="Video", infoLabels=video_info)
    liz.setProperty("IsPlayable","true")
    xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=_url, listitem=liz, isFolder=False)
Reply
#2
Check your settings. Continuous playback is not the default behaviour.
Reply
#3
(2023-12-31, 15:33)Roman_V_M Wrote: Check your settings. Continuous playback is not the default behaviour.

So it actually depends on Kodi's settings?
I mean it has nothing to do with the code of the addon?

There are two options that I found:
- Kodi settings -> Player settings -> Video -> "Play next video automatically" -> But I don't find an option to disable it, only multiple selection of media types.
- Kodi settings -> Player settings -> Music -> "Play next song automatically"

How do I know which setting is relevant to my case here?
Reply
#4
(2023-12-31, 18:43)burekas Wrote:
(2023-12-31, 15:33)Roman_V_M Wrote: Check your settings. Continuous playback is not the default behaviour.

So it actually depends on Kodi's settings?
I mean it has nothing to do with the code of the addon?

There are two options that I found:
- Kodi settings -> Player settings -> Video -> "Play next video automatically" -> But I don't find an option to disable it, only multiple selection of media types.
- Kodi settings -> Player settings -> Music -> "Play next song automatically"

How do I know which setting is relevant to my case here?
You were in the right place for videos.  The UI is a little deceptive there.  That list is all the kinds of videos, and if you select one of them, it turns a different color.  You can select as many of them as you want to enable play next automatically.  But if they are all white, they are all off.
Reply
#5
(2024-01-01, 13:20)pkscout Wrote:
(2023-12-31, 18:43)burekas Wrote:
(2023-12-31, 15:33)Roman_V_M Wrote: Check your settings. Continuous playback is not the default behaviour.

So it actually depends on Kodi's settings?
I mean it has nothing to do with the code of the addon?

There are two options that I found:
- Kodi settings -> Player settings -> Video -> "Play next video automatically" -> But I don't find an option to disable it, only multiple selection of media types.
- Kodi settings -> Player settings -> Music -> "Play next song automatically"

How do I know which setting is relevant to my case here?
You were in the right place for videos.  The UI is a little deceptive there.  That list is all the kinds of videos, and if you select one of them, it turns a different color.  You can select as many of them as you want to enable play next automatically.  But if they are all white, they are all off.
But none of them is selected.
So why when I play an item in my addon, it goes to the next item in the list when the playback ends?
How can I disable this behavior?
Reply
#6
Does it happen because the addon is a Music Addon?
Reply
#7
(2024-01-14, 01:51)burekas Wrote: Does it happen because the addon is a Music Addon?

Take a look at:  Check Settings->Player->Music->Play Next Song Automatically  and see if it is enabled.  I believe it is by default.  If that isn't it then it is likely something in the skin playback causing it, not the addon.  I am not sure what skin you are trying but make sure no repeat, shuffle or similar buttons are accidentally pressed. 

I just tested my Mezzmo Kodi addon which can operate as a video or music addon, set it to music, disabled the automatic playback and it stopped after one track.  This was using Confluence with Kodi 21 beta 2.  If all else fails post a link to your code or a debug log so we can see what is happening.


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
#8
(2023-12-31, 01:34)burekas Wrote: This is how I creating the list items:

This is a bit of a Pythonic brute force approach to creating your list items.  It is probably fine for most instances but for large lists of items on low powered device it may take longer to load the list.  I detect the Kodi version type with an RPC call and then use an if / else based upon the version.  This is a little cleaner.  Also you might want to use the listitem offscreen option to speed things up.  I found it makes a positive difference on large lists.


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
@jbinkley60

1. Thanks. "Settings->Player->Music->Play Next Song Automatically" was enabled. I disabled it and it's ok.
2. I will take a look regarding your suggestion.
3. By the way, why when I stop the playback I don't see the progress or when the playback is finished it doesn't show it as watched?
Reply
#10
(2024-01-14, 13:48)burekas Wrote: @jbinkley60

1. Thanks. "Settings->Player->Music->Play Next Song Automatically" was enabled. I disabled it and it's ok.
2. I will take a look regarding your suggestion.
3. By the way, why when I stop the playback I don't see the progress or when the playback is finished it doesn't show it as watched?

There's a real long and a short answer to #3.  The short answer is that Kodi and some Kodi skins don't really provide much support resume pointers and played indicators for music files like with video media. 

There are some ways around these limitations, which I have used some.  For play counts I have embedded the play count value into the music item description, along with some other information.  It doesn't help from the listitem browsing view but from the info window view I can see the information.  Here's a screenshot of my example.  You can see the duration, play count and last played values.  I've also tricked Kodi into supporting a resume pointer with music since currently it is only supported with audiobooks for music / audio files.  

Here's the description formatting code and here the code which calls it.

Do realize that in my case the play count, resume pointer and similar are tracked by my source information.  If your listitems are Internet URLs or media outside of the Kodi library, this is where the solution answer gets a bit longer.

I believe some work be be happening to improve things with music media. 


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
#11
@jbinkley60

Oh, I get it, thanks.

But the url which played is "mp4" file, so what is the difference from playing a video file like in Youtube addon for example.
Should I set a different content type or something like that?
Reply
#12
(2024-01-15, 23:57)burekas Wrote: @jbinkley60

Oh, I get it, thanks.

But the url which played is "mp4" file, so what is the difference from playing a video file like in Youtube addon for example.
Should I set a different content type or something like that?

Yes, for mp4 files I would set the content type to video.   I just tested my addon being launched as a music addon but setting the content type to video for mp4 files.  I was able to see the played  and bookmark indicators.  

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
How can I prevent playlist mode in Kodi?0