Lua:Neutrino-API:PlayFile:de: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
K (Kategorien 'Videofunktionen' zugefügt) |
(Rückgabewert zugefügt) |
||
| Zeile 1: | Zeile 1: | ||
= PlayFile = | = PlayFile = | ||
{{ | {{Lua_API_Funktion1Vers|Spielt ein Moviefile (lokal oder Stream) mit dem Movieplayer ab.|PlayFile|(Parameter)|1.1|b56be92d59b2b35719dd70c5a68482b0e151f568}} | ||
{{Lua_API_Funktion_Param_Kopf}} | {{Lua_API_Funktion_Param_Kopf}} | ||
{{Lua_API_Funktion_Param_Zeile0|1|string|Titel|Wird im Infoviewer angezeigt}} | {{Lua_API_Funktion_Param_Zeile0|1|string|Titel|Wird im Infoviewer angezeigt}} | ||
| Zeile 8: | Zeile 8: | ||
{{Lua_API_Funktion_Param_Zeile1|4|string|Info2|Wird im Infoviewer an Stelle der nächsten Sendung angezeigt (optional)}} | {{Lua_API_Funktion_Param_Zeile1|4|string|Info2|Wird im Infoviewer an Stelle der nächsten Sendung angezeigt (optional)}} | ||
{{Lua_API_Funktion_Param_Fuss}} | {{Lua_API_Funktion_Param_Fuss}} | ||
'''Rückgabewert:''' | |||
{| border="1" cellpadding="4" cellspacing="0" style="background-color: #F4F4F4;" | |||
|0 | |||
|PLAYSTATE.NORMAL | |||
|Video wurde normal beendet | |||
|- | |||
|1 | |||
|PLAYSTATE.STOP | |||
|Video wurde mit Stop-Taste beendet | |||
|- | |||
|2 | |||
|PLAYSTATE.NEXT | |||
|Rechts-Taste | |||
|- | |||
|3 | |||
|PLAYSTATE.PREV | |||
|Links-Taste | |||
|} | |||
<br /> | |||
{{Lua API Funktion Beispiel2_Kopf}} | {{Lua API Funktion Beispiel2_Kopf}} | ||
| Zeile 14: | 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 -- | |||
n:PlayFile("Killerschlümpfe", "/tmp/media/sda1/movies/Die_Killerschlümpfe.ts"); | n:PlayFile("Killerschlümpfe", "/tmp/media/sda1/movies/Die_Killerschlümpfe.ts"); | ||
oder -- | |||
Beispiel für Verwendung des Rückgabewertes | |||
(THX SatBaby für Code aus dem 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}} | ||
Version vom 9. September 2015, 09:02 Uhr
PlayFile
Spielt ein Moviefile (lokal oder Stream) mit dem Movieplayer ab.
| PlayFile(Parameter) | ab API v1.1 - Neutrino Git |
Parameter:
| Parameter | Typ | Description/Beschreibung | |
| 1 | string | Titel | Wird im Infoviewer angezeigt |
| 2 | string | Moviefile | Vollständiger Pfadname bzw. URL des Moviefiles |
| 3 | string | Info1 | Wird im Infoviewer an Stelle der laufenden Sendung angezeigt (optional) |
| 4 | string | Info2 | Wird im Infoviewer an Stelle der nächsten Sendung angezeigt (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. |
Rückgabewert:
| 0 | PLAYSTATE.NORMAL | Video wurde normal beendet |
| 1 | PLAYSTATE.STOP | Video wurde mit Stop-Taste beendet |
| 2 | PLAYSTATE.NEXT | Rechts-Taste |
| 3 | PLAYSTATE.PREV | Links-Taste |
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");
oder --
Beispiel für Verwendung des Rückgabewertes
(THX SatBaby für Code aus dem 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
|