Android Question SimpleMediaManager no RESIZE MODE effect on Animated WebP

Ferdari

Active Member
Licensed User
Longtime User
Hi everyone, im loading a local animated webp file using MediaManager.SetMediaFromFile, file loads ok and plays perfect but can set the EXTRA

B4X:
Dim extra As Map = CreateMap( MediaManager.REQUEST_RESIZE_MODE: "FILL" )

None of the options work or make a difference: FILL, FILL_WIDTH, FIT...etc, panel has 60dip x 60dip from a pre created layout, but always content(webp) overflows inside panel. my webp is 512x512px size.

Example file
24.webp

I can only see the top left corner of the image when loaded to panel.
1654419596248.png


Can you check this please @Erel.

Help are very appreciated.
 
Last edited:

Ferdari

Active Member
Licensed User
Longtime User
Works fine here:

View attachment 130036

B4X:
    MediaManager.SetMedia(Pane3, "https://cdn.programadosparaganar.com/24.webp")
    MediaManager.SetMedia(Pane1, "https://cdn.programadosparaganar.com/24.webp")
Thanks for your reply, are you using a template design or adding panels programmatically?

Im rechecking my template...
 
Upvote 0

Ferdari

Active Member
Licensed User
Longtime User
Works fine here:

View attachment 130036

B4X:
    MediaManager.SetMedia(Pane3, "https://cdn.programadosparaganar.com/24.webp")
    MediaManager.SetMedia(Pane1, "https://cdn.programadosparaganar.com/24.webp")

I tried the SMM example with no luck, it appears image always at 512px, not fitting panels:


1654539643583.png


B4X:
Dim extra As Map = CreateMap( MediaManager.REQUEST_BACKGROUND: xui.Color_Yellow)
    MediaManager.SetMediaWithExtra(Pane1, "https://cdn.programadosparaganar.com/24.webp", "image/webp", extra)

without extra map has the same results but without yellow background

What is your exact configuration to fit panel size?

Update:

If i set MIME TYPE to Image/* it fits the panel ok, but without animation, static image only.
 

Attachments

  • SMM_Example1.zip
    10.3 KB · Views: 102
Last edited:
Upvote 0

Ferdari

Active Member
Licensed User
Longtime User
I tried the SMM example with no luck, it appears image always at 512px, not fitting panels:


View attachment 130062

B4X:
Dim extra As Map = CreateMap( MediaManager.REQUEST_BACKGROUND: xui.Color_Yellow)
    MediaManager.SetMediaWithExtra(Pane1, "https://cdn.programadosparaganar.com/24.webp", "image/webp", extra)

What is your exact configuration to fit panel size?
This is how it looks here:

View attachment 130088

WebP is a native feature in Android. I've tested it on an Android 12 device. I guess that you are using an older version which doesn't support scaling animated WebP images.
images are playing or just static?

i tested on Android 9 emulator, and Android 10 real with same results.

So conclussions for AnimatedWebp om SMM:
Unstable on Android 11 to lower?
Works only on Android 12+?
Not a replacement for other solutions
Experimental use only.


So i keep using my old library based on Pengfeizhou apng webp, until a real B4A awebp native solutionšŸ˜­
 
Last edited:
Upvote 0

asales

Expert
Licensed User
Longtime User
Tested in 3 real devices:
- Android 7 - don't show any images
- Android 10 - animated webp - don't fit in the small panel
- Android 12 - animated webp - fit in different panel sizes
 
Upvote 0

Ferdari

Active Member
Licensed User
Longtime User
Tested in 3 real devices:
- Android 7 - don't show any images
- Android 10 - animated webp - don't fit in the small panel
- Android 12 - animated webp - fit in different panel sizes
im thinking on using webview + css, but still not tested if it consumes high resources in a listview(every item with a webview), my lib currently has some critical errors, i will test this week.
 
Upvote 0
Top