v17 Background Music in Kodi
#1
Hi,

I recently built a HTPC and installed Kodi. Kodi is a great application which suits my needs as a media center. I need to play background music while I start Kodi and until I select a movie title the music should continue playing. After the movie selection, the music should stop and movie should play. After watching the movie the music should play again while browsing. All this should be done in the background. I am new to Kodi and I don't know how the scripts or plugins work. Can anyone tell me the method to do this. Thanks in advance.
Reply
#2
general addon dev info:
http://kodi.wiki/view/Add-on_development

service addon example:
http://kodi.wiki/view/Service_addons

kodi Player docs:
https://codedocs.xyz/xbmc/xbmc/group__py...layer.html
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
#3
Hi ronie,

Thanks for your reply. Previously I saw a thread where they were using Callbacks addon for this function. Can you explain on how to do this. I am new to writing scripts and programming. I am specifying the path below. I also asked in that thread itself but I got no reply. Can you help me with this. I really needed this feature. Thank you so much.

https://forum.kodi.tv/showthread.php?tid=171177
Reply
#4
the callbacks addon is in our repo, so just install it and check if it suits your need.

there's a support thread for the addon here:
https://forum.kodi.tv/showthread.php?tid=256170

and a manual there:
http://kodi.wiki/view/Add-on:Kodi_Callbacks
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
#5
Hi,

Thanks for the manual. I will check this and revert back. Thanks once again.
Reply
#6
Hi ronie,

I installed the callbacks addon and from kodi interface I found that I can run a script or python file at startup. The point is, I don't know how to write a script for playing background music. Do you have any script that you know that can make the job done.

Thanks in advance.
Reply
#7
perhaps you don't need to write a python script?

the callback addon allows you to execute built-in commands, so you could try a task like this:
Code:
PlayMedia(/path/to/your/playlist)

then create two events to run this task: onStartup / onPlayBackEnded
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
Thank you so much for the information. I thought it would be a huge process. This really helped me a lot.



Thank you once again.
Reply
#9
Hi Ronnie,

If I wanted to play a playlist of songs randomly, what should I do ?
Reply
#10
Hi Ragu24 and others that come here for the same thinq hahaha

Install the add-on callback (thank you guys, its awesome)

Create a notepad file with this:

import xbmc
xbmc.executebuiltin("PlayerControl(RandomOn)")
xbmc.executebuiltin("PlayMedia(
Code:
/path/to/your/playlist
)")

Save with the name backgroundmusic.py

Go to the add on settings, create a new python task and use the python file backgroundmusic.py, after this go to events and select the task with the events you wish.

Its all, enjoy.

Thank you
Reply

Logout Mark Read Team Forum Stats Members Help
Background Music in Kodi0