Lua:Neutrino-API:PlayFile:en

Aus TuxBoxWIKI
Version vom 13. September 2015, 16:27 Uhr von Dbt (Diskussion | Beiträge) (aktualisiert)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

PlayFile

Play a movie file (local or stream) on the Neutrino MoviePlayer.

PlayFile(Parameter) ab API v1.1   -   Neutrino Git


Parameter:

Parameter Typ Description/Beschreibung
1 string Title show in infobar
2 string Moviefile full path or URL to movie file
3 string Info1 show on infobar instead current event (optional)
4 string Info2 show on infobar instead next event (optional)
en: Parameters with default-values are optional. If not needed, no definition is required. In case of missing parameter, default value is used.

de: Parameter mit Default-Wert sind optional. dh. sie müssen nicht angegeben werden. Falls der Parameter fehlt, wird automatisch dieser Wert angenommen.


Returnvalue:

0 PLAYSTATE.NORMAL video ended normally
1 PLAYSTATE.STOP video ended with stopp key
2 PLAYSTATE.NEXT right key
3 PLAYSTATE.PREV left key


Example:

local n = neutrino()
n:PlayFile("Dräschden...", "rtmp://video07.kanal8.de/dresdenfernsehenlive/myStream.sdp");

 -- oder --

n:PlayFile("Killerschlümpfe", "/tmp/media/sda1/movies/Die_Killerschlümpfe.ts");

 -- or --

 -- example for used return value
 -- (THX SatBaby für Code from MTV Plugin)
local i = 1
local KeyPressed = 0
repeat
	local url = getvideourl(glob.MTVliste[i].url)
	if url then
		if glob.MTVliste[i].name == nil then
			glob.MTVliste[i].name = "NoName"
		end
		KeyPressed = n:PlayFile( glob.MTVliste[i].name,url);
	end
	if KeyPressed == PLAYSTATE.NORMAL then 
		i=i+1
	elseif KeyPressed == PLAYSTATE.STOP then
		break
	elseif KeyPressed == PLAYSTATE.NEXT then
		i=i+1
	elseif KeyPressed == PLAYSTATE.PREV then
		i=i-1
	else
		print("Error")
		break
	end
until i==0 or i == #glob.MTVliste+1