fix to loop only on visible frames when playing