How to play mp4/gif in Studio?

Could you give an example to play mp4/gif in Studio?

The gif can be added to the UI Element, but it doesn’t play.

Thanks,

Hi! I’m working on a sample project for this. Expect it soon! :slight_smile:

Great! Thank you very much!

:gift:

Note: You’ll want to convert your GIF to MP4. WebGL doesn’t play well with the gif format apparently.

Awesome! Thank you. I will try it out tomorrow.

@GeorgeButler I just found that the video can not be played on iPhone Chrome because of the following errors, but it works on iPhone Safari.

â–Ľ Unhandled promise rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
    at play [native code]
    at (anonymous) videoSurface.ts:161:25 videoElement.play()
    at Bp runtime.js
    at e runtime.js
    at trigger runtime.js
    at (anonymous) videoSurface.ts:194:20
    at (anonymous) runtime.js
    at w runtime.js
    at tick runtime.js
    at E runtime.js
    at (anonymous) runtime.js
    at e runtime.js

Can you land your changes and share your project with the support workspace so I can take a look? Also which model of iPhone are you testing with?

Thank you!

Just shared. iPhone 16 Pro.

I’ve tested this on Safari and an iPhone 16 Pro Max, and it appears to be working. However, the first attempt to play the video is denied, and it only starts after the user taps the video surface again. This seems to be a restriction in Safari, likely preventing autoplay before the user has interacted with the page.

I recommend integrating the Splash Screen sample project into your setup to see if the issue persists. This might help ensure the video playback works with Safari’s user interaction requirements.

Thank you!

Could you test it with iPhone 16 Pro Max Chrome? It didn’t work on my end.

Not auto-play is OK for me.

Best,

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.