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

[Bug]: Videos always start automatically ignoring settings since shaka-player updated to 4.13.0 #6670

Open
6 tasks done
Gorrrg opened this issue Jan 30, 2025 · 16 comments
Open
6 tasks done

Comments

@Gorrrg
Copy link

Gorrrg commented Jan 30, 2025

Guidelines

  • I have encountered this bug in the latest release of FreeTube.
  • I have encountered this bug in the official downloads of FreeTube.
  • I have searched the issue tracker for open and closed issues that are similar to the bug report I want to file, without success.
  • I have searched the documentation for information that matches the description of the bug I want to file, without success.
  • This issue contains only one bug.

Describe the bug

  1. Go to Settings->Player turn "Start Videos Automatically" off
  2. Open a video
  3. The video starts playing automatically

Expected Behavior

When autoplayVideos is set to false and a video is opened it shouldn't start automatically.

Issue Labels

feature stopped working

FreeTube Version

Build 5538

Operating System Version

Windows 11 24H2

Installation Method

.exe

Primary API used

Local API

Last Known Working FreeTube Version (If Any)

Build 5537

Additional Information

No response

Nightly Build

@EsmailELBoBDev2
Copy link

EsmailELBoBDev2 commented Jan 31, 2025

i can confirm, any workaround?

Arch linux, installed via flatpak

@cedartux
Copy link

I have the same error as well. Arch linux, installed using AUR source files.

Could the problem be with one of the event listeners in AutoplayToggle.js?

@kommunarr
Copy link
Collaborator

Possible but unlikely due to that toggle referring to the other type of autoplay (playing the next video versus starting the just-loaded one). First thing to do would be to check in https://shaka-player-demo.appspot.com and manipulating the HTML to disable the autoplay property to see if it's a Shaka issue.

@cedartux
Copy link

Okay. I'm not too good with vue code, but I wanted to try to help as I enjoy this software.

I saw this in the vue code of the shaka player: "autoplayVideos ? true : null". Is there a possibility that when this is rendered in HTML, the video has the 'autoplay' attribute attached to it?

@kommunarr
Copy link
Collaborator

No worries @cedartux, appreciate the looking into it. That variable is different from the one that controls whether the next video is loaded in after the current one (autoplayEnabled, admittedly not the best naming schema). If you set up FreeTube locally in dev mode as per the documentation here, you can see the effect of just setting autoplay="null" directly and seeing what happens. It still doesn't work correctly, which implies that it might be an issue upstream with Shaka.

@cedartux
Copy link

cedartux commented Feb 1, 2025

Okay, I will look into that and check this out. Thanks @kommunarr.

@profucius

This comment has been minimized.

@belenos

This comment has been minimized.

@ClaudeLib

This comment has been minimized.

@Veeno
Copy link

Veeno commented Feb 1, 2025

Possible but unlikely due to that toggle referring to the other type of autoplay (playing the next video versus starting the just-loaded one). First thing to do would be to check in https://shaka-player-demo.appspot.com and manipulating the HTML to disable the autoplay property to see if it's a Shaka issue.

There are three relevant toggles in the settings. The first two I think refer to the autoplay you're talking about, whereas the third one is supposed to affect the automatic playing of a manually loaded video ("manually" meaning the video was not loaded via one of the first two autoplay mechanisms, since if it was, it should start automatically playing regardless of the third toggle). Currently, any manually loaded video starts automatically playing even with all three toggles turned off.

Image

@BobbyMcJefferson

This comment has been minimized.

@cedartux
Copy link

cedartux commented Feb 1, 2025

Possible but unlikely due to that toggle referring to the other type of autoplay (playing the next video versus starting the just-loaded one). First thing to do would be to check in https://shaka-player-demo.appspot.com and manipulating the HTML to disable the autoplay property to see if it's a Shaka issue.

I went to the shaka player and played one of the videos. When it loaded, it automatically started playing. I then used developer tools and removed the autoplay="" attribute from the video element. Once I clicked the video to play, it did not start automatically. So I guess have to find a way to have the autoplay attribute to be removed from the video element in the shaka player when the option is toggled off.

@ozrendev
Copy link

ozrendev commented Feb 1, 2025

I went to the shaka player and played one of the videos. When it loaded, it automatically started playing. I then used developer tools and removed the autoplay="" attribute from the video element. Once I clicked the video to play, it did not start automatically. So I guess have to find a way to have the autoplay attribute to be removed from the video element in the shaka player when the option is toggled off.

The autoplay attribute isn't being added to the video element when it's disabled. The autoplayVideos variable is being set and read correctly and conditionally adding/removing the autoplay attribute as intended. You can check this by inspecting the video element.

Downgrading to shaka-player@4.11.10 fixes the bug, so I guess something was introduced to shaka-player that breaks the autoplay attribute?

@RundownRhino
Copy link

Downgrading shaka-player to <4.13 (resolves to 4.12.10) seems to be enough to fix this for me, no need to go all the way to 4.11.

@ihatemakinganaccount
Copy link

@RundownRhino How do you downgrade only the Shaka player? Is that a separate package or integrated into freetube? I'm using Fedora 41 and freetube via flatpak, I'm not seeing any package with a name like that

@RundownRhino
Copy link

@ihatemakinganaccount It's a FreeTube dependency, so you'd have to clone the repo, alter package.json to say

-    "shaka-player": "^4.13.0",
+    "shaka-player": "<4.13",

and build (yarn install, npm run build). And I'm not sure how to build the flatpak; I think it's done by this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To assign
Development

No branches or pull requests