2011-03-13, 12:48
Hi people. I'm new to XBMC development. I've had a play with a few plugins, but not touched XBMC proper, until now
Working on the iPlayer plugin, I found a problem that using the JSON API I can't play ASX files. I tracked this down to the fact that the JSON API uses g_ApplicationMessenger to play files. This function takes a list of file items, creates a playlist and starts playing using g_Application.PlayFile.
The problem with this is that some playable types (last fm streams, smart playlists) can't be handled in a playlist, and thus are called by the function g_Application.PlayMedia (which handles these special cases and then falls through to PlayFile). Currently he only way to access the PlayMedia function is by using ExecuteBuiltin('PlayMedia'). However it seems we want to move away from the ExecuteBuiltin function for common tasks.
In regards to this I've modified the g_ApplicationMessenger function to see if it has been asked to play a single file (that isn't a playlist). If so then it passes that to PlayMedia instead of PlayFile. This allows these special types to be handled. Secondly I have allowed PlayMedia to resolve Plugin types and call itself again. This allows plugins to resolve to last fm streams, smarts playlists, internet playlists etc using setResolvedURL.
As this is my first hacking of XBMC, I'm not sure what the procedure is to have other people look at this. My changes are in a branch on my forked repo https://github.com/AWilco/xbmc/commits/wilcodev
commits https://github.com/AWilco/xbmc/commit/9f...5b168a6f85
and https://github.com/AWilco/xbmc/commit/6d...77226220cd
are the 2 changes.
Unfortunately this branch has some changes to keyboard.xml that I use with my setup. Do you need a completely clean branch or can you cherry-pick the commits with github?
Working on the iPlayer plugin, I found a problem that using the JSON API I can't play ASX files. I tracked this down to the fact that the JSON API uses g_ApplicationMessenger to play files. This function takes a list of file items, creates a playlist and starts playing using g_Application.PlayFile.
The problem with this is that some playable types (last fm streams, smart playlists) can't be handled in a playlist, and thus are called by the function g_Application.PlayMedia (which handles these special cases and then falls through to PlayFile). Currently he only way to access the PlayMedia function is by using ExecuteBuiltin('PlayMedia'). However it seems we want to move away from the ExecuteBuiltin function for common tasks.
In regards to this I've modified the g_ApplicationMessenger function to see if it has been asked to play a single file (that isn't a playlist). If so then it passes that to PlayMedia instead of PlayFile. This allows these special types to be handled. Secondly I have allowed PlayMedia to resolve Plugin types and call itself again. This allows plugins to resolve to last fm streams, smarts playlists, internet playlists etc using setResolvedURL.
As this is my first hacking of XBMC, I'm not sure what the procedure is to have other people look at this. My changes are in a branch on my forked repo https://github.com/AWilco/xbmc/commits/wilcodev
commits https://github.com/AWilco/xbmc/commit/9f...5b168a6f85
and https://github.com/AWilco/xbmc/commit/6d...77226220cd
are the 2 changes.
Unfortunately this branch has some changes to keyboard.xml that I use with my setup. Do you need a completely clean branch or can you cherry-pick the commits with github?