mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CLuaInstVideo: Add setSinglePlay()
- When setSinglePlay() Neutrino returns after playing a movie immediately in the tv/radio modus back - Set Lua api version to 1.29 Example: video = video.new() video.setSinglePlay() video.PlayFile(...)
This commit is contained in:
@@ -62,6 +62,7 @@ void CLuaInstVideo::LuaVideoRegister(lua_State *L)
|
||||
{ "channelRezap", CLuaInstVideo::channelRezap },
|
||||
{ "createChannelIDfromUrl", CLuaInstVideo::createChannelIDfromUrl },
|
||||
{ "getNeutrinoMode", CLuaInstVideo::getNeutrinoMode },
|
||||
{ "setSinglePlay", CLuaInstVideo::setSinglePlay },
|
||||
{ "__gc", CLuaInstVideo::VideoDelete },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
@@ -115,7 +116,12 @@ int CLuaInstVideo::PlayFile(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (CMoviePlayerGui::getInstance().getBlockedFromPlugin() == false)
|
||||
bool sp = false;
|
||||
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||
CLuaVideo *D = VideoCheckData(L, 1);
|
||||
sp = D->singlePlay;
|
||||
}
|
||||
if ((sp == false) && (CMoviePlayerGui::getInstance().getBlockedFromPlugin() == false))
|
||||
CMoviePlayerGui::getInstance().setBlockedFromPlugin(true);
|
||||
|
||||
const char *title;
|
||||
@@ -193,6 +199,18 @@ int CLuaInstVideo::getNeutrinoMode(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CLuaInstVideo::setSinglePlay(lua_State *L)
|
||||
{
|
||||
bool mode = true;
|
||||
int numargs = lua_gettop(L);
|
||||
if (numargs > 1)
|
||||
mode = _luaL_checkbool(L, 2);
|
||||
|
||||
CLuaVideo *D = VideoCheckData(L, 1);
|
||||
D->singlePlay = mode;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaInstVideo::VideoDelete(lua_State *L)
|
||||
{
|
||||
CLuaVideo *D = VideoCheckData(L, 1);
|
||||
|
Reference in New Issue
Block a user