Req Addition to Player.Open
#1
A way to play directory item not in picture mode.

Perhaps add a media type parameter to choose how to handle the directory.

This could also help to correct the bug when you use Player.Open on a .m3u that will lead to the internal player trying to read it as a picture.
Reply
#2
I kindof have this on my TODO list to improve in general. Being able to play directories needs a lot of improvement also in Playlist.Add/Insert.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
https://github.com/xbmc/xbmc/pull/2567 with previous commit should handle all the needs.
Reply
#4
I'm very glad to see iterations on the playlist interface. I've run into many interesting behaviors with json-rpc and pictures playlists under Frodo.

For example, playing a directory will play it as a slideshow unless it contains videos, in which case it will play the videos only (no pictures). If you add items to the pictures playlist, the pictures play normally, but playback hangs on videos with a black screen.

Do either of you know if it's possible using json-rpc to replicate the behavior of playing an xbmc source that contains photos and videos? This works perfectly in the UI, but via json-rpc has the strange behavior described above. By chance are any of the xbmc built-in functions exposed via json-rpc? I know I can access this via add-ons and the python interface but can't seem to see how to do this via json-rpc.

Also, I'd love to be able to catch events like PlayerStarted or PlayerStopped with the slideshow the way you can with video playback. If you could point me in the right direction on how to look at existing tickets/backlog and how to contribute I'd be more than happy to.
Reply
#5
The issue with picture playlists seems to still exist in the most recent Gotham nightly build.

If I start a picture slideshow from the XBMC UI in a directory that contains pictures and videos, it loops perfectly and plays both videos and photos.

However, if I do a Files.GetDirectory via json-rpc and try to iterate over the array of resulting files adding them to the playlist it appears that video files silently fail. Am I doing something incorrect in my Playlist.Add request? Is it possible to specify the media type to make the video file add requests succeed? It would seem like this must be possible since the XBMC UI can generate a valid picture playlist that contains both picture and video files.

Case 1: Slideshow via playlist from xbmc ui

Playlist.GetItems request

Code:
{"params": {"playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.GetItems"}

Playlist.GetItems response (as expected)
Code:
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "items": [
            {
                "type": "picture",
                "label": "IMG_2314.MOV"
            },
            {
                "type": "picture",
                "label": "IMG_2317.jpg"
            },
            {
                "type": "picture",
                "label": "IMG_2318.jpg"
            },
            {
                "type": "picture",
                "label": "IMG_2319.jpg"
            }
        ],
        "limits": {
            "start": 0,
            "total": 4,
            "end": 4
        }
    }
}


Case 2: Slideshow via playlist from json-rpc


Files.GetDirectory request
Code:
{"params": {"directory": "/Users/xbmc_test"}, "jsonrpc": "2.0", "id": 1, "method": "Files.GetDirectory"}

Files.GetDirectory response
Code:
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "files": [
            {
                "filetype": "file",
                "type": "unknown",
                "file": "/Users/xbmc_test/IMG_2319.jpg",
                "label": "IMG_2319.jpg"
            },
            {
                "filetype": "file",
                "type": "unknown",
                "file": "/Users/xbmc_test/IMG_2318.jpg",
                "label": "IMG_2318.jpg"
            },
            {
                "filetype": "file",
                "type": "unknown",
                "file": "/Users/xbmc_test/IMG_2317.jpg",
                "label": "IMG_2317.jpg"
            },
            {
                "filetype": "file",
                "type": "unknown",
                "file": "/Users/xbmc_test/IMG_2314.MOV",
                "label": "IMG_2314.MOV"
            }
        ],
        "limits": {
            "start": 0,
            "total": 4,
            "end": 4
        }
    }
}

Playlist.Add requests and responses:
Code:
{"params": {"item": {"file": "/Users/xbmc_test/IMG_2319.jpg"}, "playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.Add"}
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "OK"
}

{"params": {"item": {"file": "/Users/xbmc_test/IMG_2318.jpg"}, "playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.Add"}
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "OK"
}

{"params": {"item": {"file": "/Users/xbmc_test/IMG_2317.jpg"}, "playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.Add"}
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "OK"
}

{"params": {"item": {"file": "/Users/xbmc_test/IMG_2314.MOV"}, "playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.Add"}
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "OK"
}

Playlist.GetItems request
Code:
{"params": {"playlistid": 2}, "jsonrpc": "2.0", "id": 1, "method": "Playlist.GetItems"}

Playlist.GetItems response
Code:
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "items": [
            {
                "type": "picture",
                "label": "IMG_2317.jpg"
            },
            {
                "type": "picture",
                "label": "IMG_2319.jpg"
            },
            {
                "type": "picture",
                "label": "IMG_2318.jpg"
            }
        ],
        "limits": {
            "start": 0,
            "total": 3,
            "end": 3
        }
    }
}
Reply
#6
This is not possible with JSON Smile

Each playlist can only accept media from the correct type.

I don't know how the GUI does to force video to be seen as pictures but currently there's no way to achieve that remotely.
Reply
#7
I believe this is why: https://github.com/xbmc/xbmc/pull/2580#i...t-16135009
Reply
#8
(2013-06-16, 12:21)Tolriq Wrote: This is not possible with JSON Smile

Each playlist can only accept media from the correct type.

I don't know how the GUI does to force video to be seen as pictures but currently there's no way to achieve that remotely.

Thanks, Tolriq. I was hoping this wasn't the answer, but increasingly expecting as much. Smile

I think there might be a possible workaround...jsonrpc has an Addons.ExecuteAddon method that can launch an addon and pass an array which could include the photo/video files I want to play in the slideshow. The Python interface can access the XBMC built-in methods, which include SlideShow(dir [,recursive, [not]random]). Unfortunately, though, I'll need to copy the files to a tmp directory because the SlideShow method only takes a directory as input and not a playlist. I'm hoping at minimum this can replicate the behavior of the GUI.

If you or anyone else has a better idea of how to accomplish this I'd love to know! Do you happen to know what the XBMC team uses to track issues and fixes? Is it all done in Github or do they use something else like Github?

I'd love to look at the C code and see if there isn't a way to improve the playlist behavior...especially for pictures. I've documented some unexpected behavior, which I'll list below for others to see:


* When you Player.Open a directory containing both videos and photos, only videos are added to videos playlist and played.
* When you Player.Open a path containing both videos and photos, only pictures are added to pics playlist and played.
* When you Playlist.Add both video and picture files to video playlist, it adds all files to the playlist, but only plays videos, ignores pics in the playlist
* When you Playlist.Add both video and photo files to pics playlist, it adds only pic files to playlist. videos are not added to the playlist (unlike the video playlist above.
* Adding a video file to a picture playlist generates an error that video file is not JPEG in xbmc.log
* When you start a slideshow with video+pictures from the GUI and then stop it via the GUI, the playlist is still active (video+audio) if you 'get' it via json-rpc, but you can't restart it via Player.Open. Just goes to single picture and hangs. If it's a video, it doesn't play.
Reply
#9
(2013-06-16, 12:33)Robotica Wrote: I believe this is why:https://github.com/xbmc/xbmc/pull/2580#issuecomment-16135009

Robotica,

Thanks for sharing this commit thread. What I'm experiencing is behavior that is unchanged between Frodo and the most recent Gotham nightly. Since ulion's work on the slideshow was merged to master a month ago, I'm assuming the code is already in Gotham nightly builds?

I'm going to dig more into these changes, as I think not auto-playing videos in slideshows is worse than removing videos entirely in terms of user experience. Hopefully the behavior of slideshows is unchanged.
Reply
#10
Yes, ulions work is in the gotham nightlies.. Great that you're looking into this...
Reply
#11
So it turns out that XBMC.SlideShow(directory) doesn't work...but specifying "media":"files" using Tolriq's media type fix (https://github.com/Tolriq/xbmc/commit/30...3fbc52e95d) does allow all files (photos and videos) to get into the playlist.

Unfortunately, however, Playlist Player returns an error that the pictures are unplayable items:

Code:
05:27:18 T:140735301009792   ERROR: Playlist Player: skipping unplayable item: 3, path [/Users/xbmc_test/IMG_2319.jpg]
Reply
#12
(2013-06-16, 12:21)Tolriq Wrote: This is not possible with JSON Smile

Each playlist can only accept media from the correct type.

I don't know how the GUI does to force video to be seen as pictures but currently there's no way to achieve that remotely.

I believe ulion uses the MIME-type to correctly display mixed conten in the GUI. Like here: https://github.com/xbmc/xbmc/pull/2369

@ajoburg: did you enable video extensions for pictures?
Reply
#13
(2013-06-16, 14:19)ajoburg Wrote: .......
* When you start a slideshow with video+pictures from the GUI and then stop it via the GUI, the playlist is still active (video+audio) if you 'get' it via json-rpc, but you can't restart it via Player.Open. Just goes to single picture and hangs. If it's a video, it doesn't play.
I think there is a fix for this one: https://github.com/xbmc/xbmc/pull/2573
Reply
#14
The builtin "xbmc.executebuiltin("Action(Play)")" seems to be working: http://forum.xbmc.org/showthread.php?tid=168007
Reply
#15
Thanks Robotica. Really appreciate you updating the thread with this find. I just finished a fix in interfaces/PlayerOperations.cpp in the XBMC source to enable the same feature via the API.

http://forum.xbmc.org/showthread.php?tid...pid1451611

I really think features should be more uniformly implemented between GUI and interfaces, so hopefully we can get fixes like this into master.
Reply

Logout Mark Read Team Forum Stats Members Help
Addition to Player.Open0