Lua:Neutrino-API:PlayFile:en: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „= PlayFile = {{Lua_API_Funktion1|Play a movie file (local or stream) on the Movie Player|PlayFile|(Parameter)}} {{Lua_API_Funktion_Param_Kopf}} {{Lua_API_Funk…“) |
Dbt (Diskussion | Beiträge) (aktualisiert) |
||
| Zeile 1: | Zeile 1: | ||
= PlayFile = | = PlayFile = | ||
{{ | {{Lua_API_Funktion1Vers|Play a movie file (local or stream) on the Neutrino MoviePlayer.|PlayFile|(Parameter)|1.1|b56be92d59b2b35719dd70c5a68482b0e151f568}} | ||
{{Lua_API_Funktion_Param_Kopf}} | {{Lua_API_Funktion_Param_Kopf}} | ||
{{Lua_API_Funktion_Param_Zeile0| | {{Lua_API_Funktion_Param_Zeile0|1|string|Title|show in infobar}} | ||
{{Lua_API_Funktion_Param_Zeile1| | {{Lua_API_Funktion_Param_Zeile1|2|string|Moviefile|full path or URL to movie file}} | ||
{{Lua_API_Funktion_Param_Zeile0|3|string|Info1|show on infobar instead current event (optional)}} | |||
{{Lua_API_Funktion_Param_Zeile1|4|string|Info2|show on infobar instead next event (optional)}} | |||
{{Lua_API_Funktion_Param_Fuss}} | {{Lua_API_Funktion_Param_Fuss}} | ||
'''Returnvalue:''' | |||
{| border="1" cellpadding="4" cellspacing="0" style="background-color: #F4F4F4;" | |||
|0 | |||
|PLAYSTATE.NORMAL | |||
|video ended normally | |||
|- | |||
|1 | |||
|PLAYSTATE.STOP | |||
|video ended with stopp key | |||
|- | |||
|2 | |||
|PLAYSTATE.NEXT | |||
|right key | |||
|- | |||
|3 | |||
|PLAYSTATE.PREV | |||
|left key | |||
|} | |||
<br /> | |||
{{Lua API Funktion Beispiel2_Kopf}} | {{Lua API Funktion Beispiel2_Kopf}} | ||
| Zeile 12: | Zeile 34: | ||
n:PlayFile("Dräschden...", "rtmp://video07.kanal8.de/dresdenfernsehenlive/myStream.sdp"); | n:PlayFile("Dräschden...", "rtmp://video07.kanal8.de/dresdenfernsehenlive/myStream.sdp"); | ||
-- oder -- | -- oder -- | ||
n:PlayFile("Killerschlümpfe", "/tmp/media/sda1/movies/Die_Killerschlümpfe.ts"); | 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 | |||
</source> | </source> | ||
{{Lua API Funktion Beispiel1_Fuss}} | {{Lua API Funktion Beispiel1_Fuss}} | ||
[[Category:Lua:Neutrino-API:en]] | [[Category:Lua:Neutrino-API:en]] | ||
[[Category:Lua:Neutrino-API: | [[Category:Lua:Neutrino-API:Videofunktionen:en]] | ||
Aktuelle Version vom 13. September 2015, 16:27 Uhr
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
|