blynkkk / docs

https://docs.blynk.io
9 stars 4 forks source link

Changing widget properties (The Lottie and image animation widget) #75

Closed mariashinkevich closed 1 year ago

mariashinkevich commented 1 year ago

Below is Mark's experience of trying to change widget properties from the firmware. Please, inform what is expected behavior and what needs any adjustments.

The Lottie and image animation widget 'Auto-Play' setting and the datastream property 'autoplay' have no observable influence on the behaviour of the widget. My best guess is that the setting is intended to cause the widget to play the animation once when the device is loaded in the app, or when a datastream value changes, but this is NOT the case. The datastream value of "play" will cause the widget to play the animation when the device is loaded in the app, or when the datastream value or property changes. A datastream value of "stop" will cause the animation to not play.

I discovered that the image animation widget doesn't respond to loop=false setting for an APNG file, but it does respond to it for a GIF file. The image continues to loop and replay from the beginning for an APNG file, despite the loop setting. The commands 'play' and 'stop' work as expected for APNG and GIF files. Is it possible that somehow the loop/replay is built into the APNG file itself? I tried two APNG files and experienced the same result. Let me know if you want a comment about this added to the image animation widget documentation.

The app widget controls for 'URL', 'Auto-Play', and 'Play in Loop' don't get updated when the corresponding url, autoplay, and loop datastream properties are changed. As a result, the widget control 'Play in Loop' works when the widget is initially configured, but once the datastream property for 'loop' is set, the widget control setting is ignored. A confusing experience for a user.

FYI.. The Lottie and Image animation datastream properties 'autoplay' and 'loop' do not respond as expected to the string value of "True" when set from the firmware using Blynk.setProperty(). But they do respond to the string values of "False", or "true", or "false", and the integer values of 1 and 0.

Blynk.setProperty(V3, "autoplay", "True"); // does NOT work Blynk.setProperty(V3, "autoplay", "true"); // works as expected Blynk.setProperty(V3, "autoplay", 1); // works as expected Blynk.setProperty(V3, "autoplay", "False"); // works as expected Blynk.setProperty(V3, "autoplay", "false"); // works as expected Blynk.setProperty(V3, "autoplay", 0); // works as expected

Blynk.setProperty(V3, "loop", "True"); // does NOT work Blynk.setProperty(V3, " loop ", "true"); // works as expected Blynk.setProperty(V3, " loop ", 1); // works as expected Blynk.setProperty(V3, " loop ", "False"); // works as expected Blynk.setProperty(V3, " loop ", "false"); // works as expected Blynk.setProperty(V3, " loop ", 0); // works as expected

doom369 commented 1 year ago

@markwkiehl thanks.

Blynk.setProperty(V3, "autoplay", "True"); // does NOT work Blynk.setProperty(V3, "loop", "True"); // does NOT work

That's correct. We expect true value to be in lower case (case sensitive check).

mariashinkevich commented 1 year ago

@markwkiehl does that help you with your work?

Oleksii-QA commented 1 year ago

FYI.. The Lottie and Image animation datastream properties 'autoplay' and 'loop' do not respond as expected to the string value of "True" when set from the firmware using Blynk.setProperty(). But they do respond to the string values of "False", or "true", or "false", and the integer values of 1 and 0.

Correct. Agree with doom369

The Lottie and image animation widget 'Auto-Play' setting and the datastream property 'autoplay' have no observable influence on the behaviour of the widget. My best guess is that the setting is intended to cause the widget to play the animation once when the device is loaded in the app, or when a datastream value changes, but this is NOT the case. The datastream value of "play" will cause the widget to play the animation when the device is loaded in the app, or when the datastream value or property changes. A datastream value of "stop" will cause the animation to not play.

All correct in this

I discovered that the image animation widget doesn't respond to loop=false setting for an APNG file, but it does respond to it for a GIF file. The image continues to loop and replay from the beginning for an APNG file, despite the loop setting. The commands 'play' and 'stop' work as expected for APNG and GIF files. Is it possible that somehow the loop/replay is built into the APNG file itself? I tried two APNG files and experienced the same result. Let me know if you want a comment about this added to the image animation widget documentation.

Not correct, it is bug. Reproduced in Android only. Created separate task for team

The app widget controls for 'URL', 'Auto-Play', and 'Play in Loop' don't get updated when the corresponding url, autoplay, and loop datastream properties are changed. As a result, the widget control 'Play in Loop' works when the widget is initially configured, but once the datastream property for 'loop' is set, the widget control setting is ignored. A confusing experience for a user.

Not reproduced. I change datastream and URL, all correct with settings. 'Auto-Play', and 'Play in Loop' settings are saved correctly. Please provide full steps to reproduce

mariashinkevich commented 1 year ago

let me summarize the outcomes

We were able to reproduce some of the issues, but not all of them. @markwkiehl, can you please provide steps to reproduce the following issues?

  1. The Lottie and image animation widget 'Auto-Play' setting and the datastream property 'autoplay' have no observable influence on the behaviour of the widget. My best guess is that the setting is intended to cause the widget to play the animation once when the device is loaded in the app, or when a datastream value changes, but this is NOT the case.
  2. The app widget controls for 'URL', 'Auto-Play', and 'Play in Loop' don't get updated when the corresponding url, autoplay, and loop datastream properties are changed. As a result, the widget control 'Play in Loop' works when the widget is initially configured, but once the datastream property for 'loop' is set, the widget control setting is ignored.
Oleksii-QA commented 1 year ago

@markwkiehl

I discovered that the image animation widget doesn't respond to loop=false setting for an APNG file, but it does respond to it for a GIF file. The image continues to loop and replay from the beginning for an APNG file, despite the loop setting. The commands 'play' and 'stop' work as expected for APNG and GIF files. Is it possible that somehow the loop/replay is built into the APNG file itself? I tried two APNG files and experienced the same result. Let me know if you want a comment about this added to the image animation widget documentation.

This bug has been fixed. Now it works correctly.