Linux Xbmcbuntu and autostarting a video.
#1
Two things actually.

First- I cannot for the life of me autostart a video. I can ssh and run it using xbmc-send. I tried creating the script test.sh and it runs fine in terminal. It will not run on xbmcbuntu startup. I tried placing it in the /etc/xbmc/live.d folder, adding it to rc.local, adding it to lightdm, creating an @reboot crontab. Nothing will start the script. Runs fine if I run it through ssh after boot. I don't know if it's my lack of knowledge of the architecture or what. I have a feeling it's trying to start before xbmcbuntu is finished loading but i don't even know how to test this.

Second- Less important. Is anyone using synergy and finding the mouse portion to not be usable? Everything again works fine and the keyboard works great but the mouse just shoots off the screen and won't come back. Didn't know if anyone else had this issue. Might have to make a separate thread for this.
Reply
#2
Welcome to the XBMC forums.

Are you trying to play a video every time XBMC is launched? If so, you can create an autoexec.py file in your userdata (wiki) directory with the following contents (obviously, file path and name will need to be changed):
Code:
import xbmc
xbmc.executebuiltin( "PlayMedia(/path/to/your/video-file.ext)" )

Make autoexec.py executable:
Code:
sudo chmod +x ~/.xbmc/userdata/autoexec.py

Now, when you launch XBMC, it will display the homepage briefly and then start playing the video.
Reply
#3
Nice I will have to give that a try. Will that also work with PlayerControl(Repeat) ? Basically we are working on having a scrolling ad playing in the background at one of our sites. I got it working by using the steps below but I am not sure this is the most efficient way. Apparently the only way to repeat with code is to create a play list. This is how I got it working (5 min ago to be exact) using the init.d file. The secret was just as I thought it tried to load too soon. Added Sleep 15 in front of my script and bingo.

1. #Download xbmc-send program (took me awhile to realize this wasn't included#

Terminal: sudo apt-get install xbmc-eventclients-xbmc-send

2. #Run for XBMC for the first time creating a playlist of the movie you want to loop (I will use the move test.m4v as an example. We will assume it's saved in Movies)#

XBMC: Videos --> Files -->Movies --> test.m4v #movie will start#
Press C on keyboard --> Move mouse to left to open confluence --> Select Repeat:One --> Save -->#name it in this example ill use movie# movie

3. #Create script to run the playlist movie (as a note the playlist location is going to be long you may want to move it from the default location. I will leave it in default though. Script will be called test and we will say my xbmc username is name#

Terminal: sudo touch /etc/init.d/test
sudo nano /etc/init.d/test
#you will now be in the nano editor#
#! /bin/bash
sleep 15
xbmc-send -a "PlayMedia(/home/name/.xbmc/userdata/playlists/video/movie.m3u)" -a "PlayerControl(RepeatOne)"
Press cntrl O
Press Enter
Press Cntrl X

4.# Finally we make sure correct permissions are given to the script test#

Terminal: chmod +x /etc/init.d/test
update-rc.d test defaults


Whew that is it. After that I did a sudo reboot and we were golden. A lot more work then expected but it did work. Looking for anything easier and cleaner though. I will try the above mentioned way also. Hopefully the bots can get a hold of this and help others with this issue.

Now on to synergy.....why flaky mouse when booted to xbmc but not xbmcbuntu....hmmmm
Reply
#4
Yes, for repeat, you'll need to have autoexec.py play a playlist instead of the file itself. Aside from having to create a playlist, you just need to add one more line to your autoexec.py, as explained here: http://forum.xbmc.org/showthread.php?tid=157120
Reply
#5
XBMC is possibly not the best tool for the job? Sledgehammer/nut and all that.

How about
Code:
mplayer -fs -loop 0 /path/to/file.ext
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply

Logout Mark Read Team Forum Stats Members Help
Xbmcbuntu and autostarting a video.0