Autoplay & Repeat

Hi there!

Currently I am running OSMC on my RPI. This is the issue I have. I have to have an ongoing information center that will autorepeat everything in a playlist all the time. I’ve not found the REPEAT function.

Currently I am using the app KORE to repeat things, but this is not very usable for me.

I need to auto-start a video when my OSMC boots up, and then I need it to repeat everything in that playlist the entire time.

I’ve set up an autoexec.py script which has this

import xbmc
xbmc.executebuiltin(“PlayMedia(/home/osmc/.kodi/userdata/playlists/video/Prezentacija.mp4)” )
xbmc.executebuiltin(‘PlayerControl(repeatall)’)

And i’ve put this script into the /userdata/ !
Current issue is that OSMC does really start the “Prezentacija.mp4” after booting up, but it does NOT repeat it at all.

Is there any sort of a command for this ( like this Player Control ? ) , or is there an option so I can make OSMC autoloop everything in a playlist all the time.

Urgent!

Thank you :slight_smile:

Use raspbian with a bashscript and omxplayer.

Faster and easier than using a full mediacenter for this task it is not built for.

Edit: but to help you:
Try to use the case sensitive correct command: RepeatAll

Edit2: http://kodi.wiki/view/list_of_built-in_functionsw

1 Like

Did you solve this problem? If you did, then I would very much like to hear about it.

I’m doing an exhibition, where i need several screens to autoplay and loop just like you were trying to - but i cant make it work.

This might come in handy:

Really, for such things, plain omxplayer will suffice.

1 Like

You are right. I found an easy way to do it by starting omxplayer via rc.local:

sudo nano /etc/rc.local

Which opens up rc.local in the terminal. And then adding a line for the omxplayer to play the file at startup:

omxplayer -b --loop /home/pi/Videos/videofile.mp4

and saving by pressing “Ctrl + X” then “Y” then “Enter”. Reboot and omx will repeat indefinitely!

I haven’t found any way to stop it though. Because it is started by rc.local, it won’t respond to keyboard or mouse input. So i’m kind of shut out. Would be really nice if i shouldn’t reinstall raspian to make changes :slight_smile:
(I have made it load the videofile from USB, so i can just unplug that and reboot, but it would still be nice to know how to make it stop again.)

You could kill the process via ssh:
sudo killall -9 omxplayer

Edit: If you have your video on an usb stick, just boot without the stick inserted and omxplayer won’t start anyway.

Edit2: ok. If you already have it on usb, ssh is the way to go.

You can also change tty and login blindly. Then type the kill command.

I have it on USB, and it works fine. I just pull the power cable and restart without USB plugged. And i have been able to kill omxplayer blindly in the terminal (everything is normal behind the video image). I was just wandering, if it would be possible to start omx via rc.local as normally. So you would be able to press escape, pause and all the. It’s just the controls for the player, thats not responding to the keyboard input.

It’s not a very big problem though. I’m mostly just curious to how I can make it work more smoothly. So if you dont have any obvious way to make it run as normally, don’t bother :slight_smile: Thank you though. I’ll have a look at what tty is some time.

And regarding SSH. I haven’t made that work well enough yet. Still very new to all of this.

To make it respond to keyboard input, you would need to log in automatically and start it on an active tty.

Be sure noone can just plug in an usb keyboard and take over the pi this way then.