Automatic stream (cast) to Smart TV

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
aleks2x
Posts: 2
Joined: Wed Feb 10, 2016 4:01 am

Automatic stream (cast) to Smart TV

Post by aleks2x »

Hello everybody,

I've been trying to find a program (media server) that can do the scenario explained in the following topic and so far UMS is the only media server that is promising enough to do this.

I have 2 smart LG TVs connected in LAN. Both of them automatically turn on specifically at 7am every day and turn off at 4pm.
My first question Is: Is it possible that i can create some kind of script that can push video content to one of the tvs (corporate video) that need to loop until the tv is automatically turned off at 4pm?
My second question is: Is it possible to create a script to stream TWO JPEG photos to the second tv (slide show) until the tv is turned off automatically at 4 pm?

The idea of the photos is to be automatically added to a playlist when someone adds them in a shared folder.

The whole concept is intended to have minimum human input (besides adding the photos in the shared network folder)

Thanks in advance!

P.S. Sorry for using the word "automatically" to often :)
User avatar
valib
Developer
Posts: 699
Joined: Fri Feb 08, 2013 3:11 am

Re: Automatic stream (cast) to Smart TV

Post by valib »

All communication between a renderer and a media server is the DLNA protocol based so the renderer is always asking for the media which should be played. It is not a responsibility of a media server to push something to them. If you would be able to make a script in your smart TV then it could work. Or you can make a new UMS plugin which can use the UPnP support implemented and push the media to your TV. We don't use scripts for such cases.
infidel
Developer
Posts: 571
Joined: Thu Jul 12, 2012 5:37 am

Re: Automatic stream (cast) to Smart TV

Post by infidel »

aleks2x wrote:Is it possible that i can create some kind of script that can push video content to one of the tvs
You can try this using the jumpy plugin's (undocumented) pms.play(uri, renderer_ip) scripting command, e.g. working example in python to start a video at a given time and stop it a minute later (timedplay.py):

Code: Select all

import sys, time, jumpy

def push_at(hour, min, uri, renderer):
	while True:
		now = time.localtime()
		if now.tm_hour == hour and now.tm_min == min:
			# push the uri to the renderer
			pms.play(uri, renderer)
			return
		time.sleep(1)

# parse start time
t = sys.argv[1]
hour, min = [int(x) for x in t.split(':')]

# schedule start at hour:min
push_at(hour, min, 'c:\\video.mp4', '192.168.1.5')

# playing...

# schedule stop after one minute by pushing
# a dummy uri to interrupt previous stream
push_at(hour, min + 1, 'dummy', '192.168.1.5')
Assuming this script is located in plugins/jumpy/timer/timedplay.py, you would need to add it as an asynchronous (note the '&' at the end of the command) startup script to your jumpy-scripts.ini like so:

Code: Select all

[+timedplay]
cmd = ${home}/timer/timedplay.py 07:00 &
and it should get launched 'automatically' :) at UMS startup and wait for the appointed time before kicking in and doing its thing. The uri could be a jpeg too.

Note that you would need to script all the directory-scanning, timing and looping logic yourself in python, and push uris accordingly.
aleks2x
Posts: 2
Joined: Wed Feb 10, 2016 4:01 am

Re: Automatic stream (cast) to Smart TV

Post by aleks2x »

Thank you very much!
I'll definitely try this and let everybody know how it goes.

Kind regards!
User avatar
valib
Developer
Posts: 699
Joined: Fri Feb 08, 2013 3:11 am

Re: Automatic stream (cast) to Smart TV

Post by valib »

I have one proposal. Try to make some folder with the pistures you want to show and add that folder to the UMS shared folders. Than if your TVs are really smart there should be a choice to play the slide show. TV will be asking for all pictures from the folder and the UMS will serve it.
Post Reply