how to get the current playing frame in a video or current duration of the video
I am trying to make certain behavior happens depending on where the video is at.
For example, at 10 seconds in the video a picture shows up and at 30 seconds in the video a different picture shows up.
I have this for starters:
//@input Component.Image trailer
var provider = script.trailer.mainPass.baseTex.control;
print(provider.PlayingFramesCount())
However this give me an error:
TypeError: undefined not callable (property 'PlayingFramesCount' of [object Object])
Meaning that function is not available in the variable "provider"
Looking at the documentation, the property, PlayingFramesCount() is there: https://lensstudio.snapchat.com/api/classes/AnimatedTextureFileProvider/
In addition, it look like in the documentation the imported @input have a type of Component.SpriteVisual and mine have a Component.Image. Is that the same thing as they are both animating a texture.
If not, then how should i set up my video using SpriteVisual. It looks to be deprecated/legacy.
Poder ber videos
I don't see a "PlayingFramesCount" method on that page but I do see a "getCurrentPlayingFrame" one that sounds like what you need.
ahhh yes i tried that. That did not work. It seem that those methods only work on 2d animation and not a video.
I decided to just use getTime(). Not the best idea but it does the job for now.
I am very surprise that lens studio does not give more methods to use for imported videos.