SchildiChat / SchildiChat-android

Matrix client / Element Android fork
https://schildi.chat/android/
Apache License 2.0
386 stars 50 forks source link

Support for autoplay of animation stickers. #93

Closed DUCKCHI closed 1 year ago

DUCKCHI commented 2 years ago

Is your feature request related to a problem? Please describe. Uploaded GIF supports autoplay, but GIF stickers do not support autoplay.

Describe the solution you'd like I hope GIF stickers will also support automatic playback. In the case of element-web, autoplay of GIF and animated webp stickers is supported.

Describe alternatives you've considered SchildiChat currently supports automatic playback of GIF image files, so I think automatic playback of GIF stickers will also be possible.

Additional context

SpiritCroc commented 2 years ago

How do you get animated stickers in matrix? Is there way to send them?

DUCKCHI commented 2 years ago

Yes, there are many ways. Using maunium-stickerpicker, you can get an animation sticker by deleting the part of 'sticker/pack.py' where png is forcibly converted and switching to gif or webp.

You can also get it using the integrated manager of dimension, but it doesn't work on mobile clients.

DUCKCHI commented 2 years ago

Is there way to send them?

https://duckchi.github.io/stickerpicker/web/ As a test, I applied the gif file to maunium/stickerpicker. I think this sticker will be an example. The gif file stops in the stickerpicker, but when sticker sent, it plays on element-web and element-desktop.

SpiritCroc commented 2 years ago

Is there way to send them?

https://duckchi.github.io/stickerpicker/web/ As a test, I applied the gif file to maunium/stickerpicker. I think this sticker will be an example. The gif file stops in the stickerpicker, but when sticker sent, it plays on element-web and element-desktop.

After adding this picker to my test account in schildichat-desktop and sending the sticker, it shows as png (no animation).

DUCKCHI commented 2 years ago

There was a part where the mime-type was forced to png, so we modified that part. As a result of testing with schildichat, gif is autoplayed.

https://ibb.co/pWJCzsQ

SpiritCroc commented 2 years ago

So, sounds to me like no client really supports sending these right now then.

Feel free to send me some animated sticker, so I can play with it further and decide what to do: https://schildi.chat/contact/

Bubu commented 2 years ago

The telegram bridge sends those (which is why I'm interested in making this work as well). Here's an example event.

FWIW, I've started diving into the code for this, but I'm unsure when I'll get around to finishing it :-).

{
    "msgtype": "m.video",
    "body": "😞 (disappointed face)",
    "url": "mxc://bubu1.eu/jCxxHGygNzSRIgxwfZelGmtg",
    "info": {
      "mimetype": "video/webm",
      "size": 183558,
      "thumbnail_info": {
        "mimetype": "image/png",
        "size": 29274,
        "h": 256,
        "w": 256
      },
      "thumbnail_url": "mxc://bubu1.eu/cAYXnTtnHPjVxFxpFIxGkBqL",
      "h": 256,
      "w": 256,
      "fi.mau.telegram.animated_sticker": true,
      "fi.mau.loop": true,
      "fi.mau.autoplay": true,
      "fi.mau.hide_controls": true,
      "fi.mau.no_audio": true
    }
  }
LuckyTurtleDev commented 1 year ago

Any thing new about this issue?

Webp stickers does work on element desktop/web now. But at android it is only a static image.

My event look a little bit different as @Bubu's event:

{
  "type": "m.sticker",
  "content": {
    "url": "mxc://matrix.org/fNiXaIxltVqderOqYrqweKmO",
    "info": {
      "w": 256,
      "h": 256,
      "size": 2573482,
      "mimetype": "image/webp",
      "thumbnail_url": "mxc://matrix.org/fNiXaIxltVqderOqYrqweKmO",
      "thumbnail_info": {
        "w": 256,
        "h": 256,
        "size": 2573482,
        "mimetype": "image/webp"
      }
    },
    "body": "👋"
  }
}

The sticker was created with mstickereditor and send with the Maunium sticker picker.

The telegram bridge does sends gifs and no webp, which works fine on schildi.

SpiritCroc commented 1 year ago

https://github.com/SchildiChat/SchildiChat-android/commit/9521814f322a2976b3787682418cb0bdef99f845