-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redgifs Sound Not Enabled By Sound Checkbox [SOLUTION IMMINENT] #167
Comments
In #148 it was said that this could be accomplished by finding a way to enable sound automatically in the embed; however, I have checked with developers in the official redgifs server, and they've confirmed that they deliberately made it so there was no way to do so automatically (with flimsy justifications about preventing content from being stolen?) I've found that if you can select the Is that just it then? Redgifs decides there's no way to turn on sound without the mouse being moved to the right spot and the clicked and there's nothing we can do about it? |
OK, I know I'm getting into obscure territory here, but... I've written a userscript that implements the solution called for (which redgifs deliberately does not implement for unclear reasons) by injecting a bit of harmless code into the iframe rather than the page; if the fragment of the iframe url is precisely equal to This will work for anybody using the iframe, without compromising the security, intellectual property, or commercial activities of either RedGifs or redditp. So if redditp automatically adds the |
OK, after further testing, I've confirmed I have it working, but only in ViolentMonkey (not GreaseMonkey, which I was previously using), apparently due to single-origin policy reasons (for some reason GreaseMonkey runs the script with the origin as the page, while ViolentMonkey runs it with the origin as the iframe.) The userscript can be found at https://greasyfork.org/en/scripts/486812-redgifs-iframe-sound-helper. It does not solve this issue because we still require redditp to actually use it. The script can (a) automatically load the iframe with sound if the fragment is set to Assuming I implemented this correctly, you should not need to wait for the iframe to load before posting the Oh, and, finally, the And, as before, allowing redditp to interface with this script will not cause the website to break for users not using the script. |
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 calliframe.postMessage("soundOff", "*")
oriframe.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 thinkI had not reached the edge of my ability. #168updateSound
would need to look for iframes with a redgifs src andpostMessage()
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.The text was updated successfully, but these errors were encountered: