Startup video minimize
#1
Lightbulb 
i have modified the startupmp3.py script to start a video when xbmc starts, but the video is maximized. how can i change the script to play the video minimized automatically? i ask this because project mayhem iii has a really nice feature of minimizing music and videos to the background. here is the code in the python script i am using:

===== start =====
import xbmc

file = 'path\to\video.mpeg'
xbmc.player().play(file)
===== stop =====
Reply
#2
Sad 
if this doesn't seem possible, is there any way to add a simulated "display" button action in the code? something like:

===== start =====
import xbmc

file = 'path\to\video.mpeg'
xbmc.player().play(file)

<remote>display</remote>
===== stop =====

i'm not too smart with the code so any help would be appreciated.
Reply
#3
try this :

===== start =====
import xbmc
import xbmcgui

file = 'path\to\video.mpeg'
xbmc.player().play(file)

win=xbmcgui.window(10000)
win.show()
===== stop =====
Reply
#4
that worked! thanks solexalex!

now when xbmc starts it's nice to have a background movie playing, just to add to the effect of having the best media player!

thanks again!
Reply
#5
i was thinking the samething last night, could you help with my script? it plays playlists randomly on startup but i have video playlist and i want it to show in the background like he said with my pm3 skin......here is what it looks like

# lit une playlist aleatoirement
###################################################################
# ce code est les propriété de [email="[email protected]"][email protected][/email]
#
# version 0.1
#
###################################################################


import os.path, string
import glob, random
import xbmc, xbmcgui

filename = []
repertoire = 'q:\\albums\\playlists'

def listrep ( args, dirname, filenames ):
global filename
filename[:0] = glob.glob(dirname + '\*.m3u')

os.path.walk(repertoire, listrep, none )
a = len(filename)
if a > 0:
nb = random.randint(0,a-1)
pls = xbmc.playlist(0)
pls.load(filename[nb])
pls.shuffle()
xbmc.player().play(pls)
else:
dialog = xbmcgui.dialog()
dialog.ok(" error", " no list found")
Image
Reply
#6
Quote:file = 'q:\\albums\\playlists\\startup.m3u'
pls = xbmc.playlist(2)
pls.load(file)
pls.shuffle()
xbmc.player().play(pls)
xbmc.executebuiltin('xbmc.activatewindow(0)')

script to play random video from playlist minimized at start


to modify your code just add the line:
xbmc.executebuiltin('xbmc.activatewindow(0)')

and it will minimize the video on playback
Reply
#7
i have a combined music/video playlist

is there any possibility that once a video starts it will be automatically minimized?

right now it goes like this:

video  (-> i minimize it)
video  (still minimzed)
music
music
video (back to fullscreen)






thats the script i use now:

---------------------------------------------
#script by c. newman
#the scripts selects for a given directory with playlists one playlist and plays it immediatly

import nt, xbmc, xbmcgui
from random import random
from time import *

def getrandomplaylist(path):
seed = time()/1000
g = random(seed)
list = nt.listdir(path)
intcount = len(list)
number = g.random()*intcount
intnumber =  int(number)
return list[intnumber]


dialog = xbmcgui.dialogprogress()

#define playlist directory here
path = 'e:\\apps\\xbmc\\albums\\playlists\\auto\\'

#select playlist
playlist = getrandomplaylist(path)
dialog.create("randomly select a playlist", playlist)

xbmc.playlist(0).load(path+playlist)
xbmc.playlist(0).shuffle()
xbmc.player().play()

dialog.close()
------------------------------------------
xbmc is from april 19th


tia
Reply

Logout Mark Read Team Forum Stats Members Help
Startup video minimize0