Skip to content
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

Reels randomly getting muted #33

Open
back2Lobby opened this issue Apr 14, 2024 · 5 comments
Open

Reels randomly getting muted #33

back2Lobby opened this issue Apr 14, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@back2Lobby
Copy link

back2Lobby commented Apr 14, 2024

I am scrolling through instagram reels but it randomly mutes them. I tried to find a pattern but no success yet. I scroll both with "down arrow" and "mouse scroll-wheel", idk if that has anything to do with this. Sometimes audio plays for 2-3 seconds and then mutes and sometimes fully muted from start.

I am on Chromium / Ubuntu 22.04.

@Arcus92 Arcus92 self-assigned this Apr 14, 2024
@Arcus92
Copy link
Owner

Arcus92 commented Apr 14, 2024

I was able to reproduce it in Firefox when scrolling down fast while the Reels are loading. But it is not consistent.
Once you scroll to a new Reel I sometimes receive a mute event by Instagram. I guess since we never enable audio using the Instagram UI, Instagram thinks all videos should be muted on start. When the extension receives an audio change it assumes it comes from the user and stores these values for all upcoming videos.

There is a workaround for this already in place: After a video was started the extension ignores all volume changes for 10ms. However, this is very janky and won't work every time. I'll try to implement a better solution.

@Arcus92 Arcus92 added the bug Something isn't working label Apr 14, 2024
@back2Lobby
Copy link
Author

back2Lobby commented Apr 14, 2024

What about manually enabling audio by clicking on the Instagram reels UI audio button every time a reel loads using

const audioBtn = document.querySelector("svg[aria-label='Audio is muted']");

// this will be null if audio is unmuted
if(audioBtn) audioBtn.parentElement.click()

So, the suggestion is to unmute every time a reel loads instead of a delay. What do you say about this approach? 😶

@Arcus92
Copy link
Owner

Arcus92 commented Apr 14, 2024

I was avoiding finding the button via label texts, since they depend on your Instagram / Browser language. But I run some tests with this.
I'm currently trying to figure out why this only happens some times.

@Arcus92
Copy link
Owner

Arcus92 commented Apr 16, 2024

Spend the last two days debugging compiled React code and scrolling through an endless stream of Reels. While losing my brain capacity in the process, I discovered a way to communicate with the React components. But it is super complicated.

Instead of doing this now, I'll commit a quick workaround to release a fix soon: #34

@back2Lobby
Copy link
Author

Spend the last two days debugging compiled React code and scrolling through an endless stream of Reels. While losing my brain capacity in the process, I discovered a way to communicate with the React components. But it is super complicated.

Instead of doing this now, I'll commit a quick workaround to release a fix soon: #34

I appreciate the effort. Fr, debugging would include watching hundreds of reels cause there was no pattern lol. Also, Communicating with react components? So basically you can now have more control over Instagram or other react app cause you can communicate with other components also in the app. I will check the commit out of curiosity 🙂. We learn something new everyday after all.

Again, Thanks for the hard work. 👍

@Arcus92 Arcus92 reopened this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants