modify StretchNoLoop and StretchRewind to only run certain commands if they exist.
fixes issue #337 I also modified StretchNoLoop to start at the beginning of the movie to prevent it from freezing on the last frame (which I'm assuming is not the intended behavior; let me know if that's wrong)
This commit is contained in:
@@ -2,7 +2,17 @@ local Color1 = color(Var "Color1");
|
||||
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor(Var "File1") .. {
|
||||
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;loop,false;effectclock,"music");
|
||||
OnCommand=function(self)
|
||||
self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y)
|
||||
self:scale_or_crop_background()
|
||||
self:diffuse(Color1)
|
||||
if self.loop ~= nil then
|
||||
self:loop(false)
|
||||
-- make videos start at beginning to prevent sticking on last frame
|
||||
self:position(0)
|
||||
end
|
||||
self:effectclock("music")
|
||||
end;
|
||||
GainFocusCommand=cmd(play);
|
||||
LoseFocusCommand=cmd(pause);
|
||||
};
|
||||
|
||||
@@ -2,7 +2,15 @@ local Color1 = color(Var "Color1");
|
||||
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor(Var "File1") .. {
|
||||
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scale_or_crop_background;diffuse,Color1;position,0;effectclock,"music");
|
||||
OnCommand=function(self)
|
||||
self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y)
|
||||
self:scale_or_crop_background()
|
||||
self:diffuse(Color1)
|
||||
if self.position ~= nil then
|
||||
self:position(0)
|
||||
end
|
||||
self:effectclock("music")
|
||||
end;
|
||||
GainFocusCommand=cmd(play);
|
||||
LoseFocusCommand=cmd(pause);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user