HowTo: Xbmc Starts With Video's Playing In BG
#1
Sad 
well, since my question is a bit different from pwelico's, i opted for a new topic start:

i better explain what i would like and what i got so far...

what i would like is to have my musicvideo playlist automaticly starting everytime
i start xbmc. it needs to play the musicvideo's in the background of the "home"screen.

what i got so far is the following script "startmyvid.py" added to my "autoexec.py":
Quote:import xbmc
import os

# ---------------------------------------- #
# "configuration"
# ---------------------------------------- #

# change this to your playlist(s).
# written like this: ['path\\to\\plist1', 'to\\plist2', 'plist\\3']
playlist_files= ['f:\\files\\albums\\cache\\playlists\\video\\mv.m3u']

# dirs(s) to traverse if playlist does not exist. nb: no trailing slash.
# written like this: ['path\\to\\dir1', 'to\\dir2', 'dir\\3']
musicvideos_dirs = ['']

# shuffle playlist if this var equals 1.
shuffle_files = 1


# ---------------------------------------- #
# code
# ---------------------------------------- #

# function for adding files to playlist
def add_files(pl, dirname, names):
for filename in names:
if (os.path.isfile(dirname + "\\" + filename)):
add = 0

# check extension of file.
if (filename[-4:] == ".avi"): add = 1
if (filename[-4:] == ".mpg"): add = 1
if (filename[-4:] == ".wmv"): add = 1
if (filename[-4:] == ".asf"): add = 1
if (filename[-4:] == ".m2v"): add = 1

# if file is to be added, do it.
if (add == 1): pl.add(dirname + "\\" + filename)
elif (os.path.isdir(dirname + "\\" + filename)):
os.path.walk(dirname + "\\" + filename, add_files, pl)

# get music playlist from xbmc
plist = xbmc.playlist(0)
plist.clear()

# load playlist if it exists
for playlist_file in playlist_files:
if (os.path.isfile(playlist_file)):
plist.load(playlist_file)
# else, find all available music videos
else:
for musicvideos_dir in musicvideos_dirs:
os.path.walk(musicvideos_dir, add_files, plist)

# do the shuffle!
if (shuffle_files == 1): plist.shuffle()

xbmc.player().play(plist)
xbmc.executebuiltin('xbmc.activatewindow(0)')
it's an existing script which i edited just a bit to point to my musicvideo playlist (mv.m3u).
the last line
Quote:xbmc.executebuiltin('xbmc.activatewindow(0)')
makes the first video play in the background of the home-screen (main window),
which is perfect but the next video's are all played in fullscreen.

what i did notice, is when i start the musicvideo playlist manually (from within xbmc) and then switch manually from fullscreen to the background of the home-screen, it does play all the video's in the background, which is exactly what i want.

so the question is: what command is given when you start a video playlist manually and
what command is given when you switch manually from full screen to background mode?

if i know this the "startmyvid.py" script could be edited with these commands and the script would probably work perfectly.
Reply

Logout Mark Read Team Forum Stats Members Help
HowTo: Xbmc Starts With Video's Playing In BG0