Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Option to only play gifs on hover

Open geekgonecrazy opened this issue 10 years ago • 16 comments

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?

geekgonecrazy avatar Aug 18 '16 17:08 geekgonecrazy

or play X times and then switch to on hover

Jellyfrog avatar Aug 18 '16 17:08 Jellyfrog

What gifs do you mean? Is there some native support for providers like imgur? I just know that https://github.com/FinndropStudios/GifRocket webhook?

FibreFoX avatar Aug 18 '16 17:08 FibreFoX

@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.

geekgonecrazy avatar Aug 18 '16 19:08 geekgonecrazy

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.

subesokun avatar Aug 20 '16 11:08 subesokun

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.

FibreFoX avatar Aug 20 '16 12:08 FibreFoX

Something like this: http://rubentd.com/gifplayer/ ?

gabrielsixel avatar Sep 09 '16 12:09 gabrielsixel

@gabrielsixel exactly. Something that wouldn't bog down the render thread.

geekgonecrazy avatar Sep 09 '16 20:09 geekgonecrazy

@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:-

This not only provides more controls with simple already built controls, but also reduces file size and improves performance of servers. Source What say?

sushant52 avatar Jan 22 '21 20:01 sushant52

@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

ritwizsinha avatar Apr 16 '21 13:04 ritwizsinha

@RocketChat/frontend if work here won't be accepted please chime in so no one wastes time 🙏

geekgonecrazy avatar Apr 17 '21 00:04 geekgonecrazy

@geekgonecrazy I looked at the code and understood, what had to be done gif-issue-rocketchat. 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?

ritwizsinha avatar Apr 23 '21 14:04 ritwizsinha

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.

MondaySam avatar Jul 14 '21 10:07 MondaySam

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

3id0 avatar Sep 30 '21 15:09 3id0

GIFs need autoplay.

sennewood avatar Nov 16 '21 14:11 sennewood

@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?

norogoth avatar Aug 10 '22 20:08 norogoth

It would be amazing if we could revisit this issue. It would be wonderful to be able to pause endlessly playing gifs.

stephentgrammer avatar Nov 06 '24 17:11 stephentgrammer