Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign url type to source fail to load the animation #2

Open
SteveKChiu opened this issue Jul 12, 2019 · 1 comment
Open

Assign url type to source fail to load the animation #2

SteveKChiu opened this issue Jul 12, 2019 · 1 comment

Comments

@SteveKChiu
Copy link

If I assign an url (not string) to the source property, the LottieAnimation fail to play, for example:

LottieAnimation {
    source: Qt.resolvedUrl("aaa/a.json")
}

It seems the source can accept javascript object as well, but url is also an 'object' type in qml, the code even have the comment:

if (typeof source === "object") { // TODO what about QUrl, I think it is treated as {} here

I would suggest test of actual lottie property in this case (like 'v' in lottie spec)

https://github.com/airbnb/lottie-web/blob/master/docs/json/animation.json

if ((typeof source === "object") && source["v"]) {

That should solve the problem.

@kbroulik
Copy link
Owner

Pull requests welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants