Skip to content

Sound Not Enabled By Sound Checkbox [SOLUTION IMMINENT] (on certain sites) #167

Description

@omegasome

As the title says; videos on redgifs play, but play with sound disabled, not matter what the sound checkbox is set to. Videos with sound have to be manually enabled, for each video, with the icon in the upper right hand corner of the embed.

Expected behavior: Selecting the sound checkbox should automatically enable audio on any videos loaded from redgifs.

This seems to have been previously addressed by #148 (which was changed some time after posting from "redgifs" to the defunct-but-functionally-similar site "gfycat"), but it's broken again.

Skip my replies, read this.

As you can see I spent a bit of time narrating what I was doing. The tl;dr is that I made a userscript, compatible with ViolentMonkey but not GreaseMonkey, which will allow redditp (pending a small update) to control sound on RedGIFs without affecting users without the script by (safely!) circumventing the single-origin policy.

redditp just needs to be updated to either call iframe.postMessage("soundOn", "*") on the redgifs iframe or set the url of redgifs embeds to have the querystring ?sound=true, and if the sound checkbox is clicked while a redgifs video is playing then call iframe.postMessage("soundOff", "*") or iframe.postMessage("soundOn", "*") as appropriate.

This would all also apply to gfycat if gfycat weren't defunct.

I would love to go the last step and create a PR to have redditp use this cute lil API I've created, but I think this has reached the edge of my javascript ability for now. I poked around in EmbedIt.js and script.js, wasn't quite sure what to do. I think updateSound would need to look for iframes with a redgifs src and postMessage() accordingly. If it doesn't look exclusively for redgifs iframes it could collide with certain browser extensions. That will handle checking/unchecking sound, the only thing left is to make sure sound gets turned on when the image is loaded. I had not reached the edge of my ability. #168

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions