Option to only play gifs on hover
On native clients we seem to run into a problem where too many gifs playing causes the render loop to get blocked. We need to adopt what other platforms have done, and don't play them automatically. Maybe only hover?
or play X times and then switch to on hover
What gifs do you mean? Is there some native support for providers like imgur? I just know that https://github.com/FinndropStudios/GifRocket webhook?
@Jellyfrog that would work too.
@FibreFoX so if you post a link to a gif it'll show up and start playing. These might be posted by a user, by gifRocket etc. The idea is to not have those play automatically. Just imagine someone went a little gif crazy and pasted links to 10-15 gifs. You now have all 10-15 of those gifs playing at the same time. Eating through resources that you don't necessarily want them to be. It can bog down your chat.
I'd love to see a play button just like Twitter does. Once the animation has completed it should stay in paused mode. Also it should remember that the Gif has been played already once so that it won't be played again if you enter the room or scroll around.
This should be a customizable option of the user, but not "on hover", mobile devices don't have hover, "on click"/"on tap" would be nice to have available here.
Something like this: http://rubentd.com/gifplayer/ ?
@gabrielsixel exactly. Something that wouldn't bog down the render thread.
@geekgonecrazy @ggazzo We could convert the GIF to .mp4 video format and use the video controls to play/pause the GIF, and also add a loop, autoplay, muted options to give it more GIFy feel if one wants to.
Examples of popular website already doing this:-
- Twitter converts animated GIFs to MP4 files on upload
- Pinterest improves performance by converting GIF to mp4
- IMGUR, a site full of GIFs, converts GIFs to HTML5 video
This not only provides more controls with simple already built controls, but also reduces file size and improves performance of servers. Source What say?
@geekgonecrazy I am working on this feature, I will first try to implement a simple click/tap for play and stop and if that looks good may be I could do some of the optimizations mentioned above. Thanks
@RocketChat/frontend if work here won't be accepted please chime in so no one wastes time 🙏
@geekgonecrazy I looked at the code and understood, what had to be done
.
I tried adding a wrapper for Image component and a variable controlling toggle when clicked. The stopped gif contains the preview url.
One problem arises is how to care of the open attachment feature when clicked, when the gif is running, clicking on the gif does two things as shown above (opens the attachment and stops the gif).
One solution is to remove the action of stopping a gif and automatically stopping it after one run.
wdyt?
Please make the gif stop playing after one run or two. We like to post reaction gifs via /giphy but it quickly gets annoying when those gifs are constantly running. Especially when you have the chat open on another screen and constantly see movement in your peripheral view.
Please make the gif stop playing after one run or two. We like to post reaction gifs via /giphy but it quickly gets annoying when those gifs are constantly running. Especially when you have the chat open on another screen and constantly see movement in your peripheral view.
I disagree. I mean its a sane option as a default but probably better to let the user choose with a configuration option on the client side. Also you are allowed to minimize your chat window if it bothers you :p
GIFs need autoplay.
@sennewood is correct. If GIFs in Rocketchat can't autoplay, is life even truly worth living?
Also, I feel like GIFs used to autoplay and now they don't after an update or something. Anyone know why that may be?
It would be amazing if we could revisit this issue. It would be wonderful to be able to pause endlessly playing gifs.