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

Closed
6 tasks done
Gorrrg opened this issue Jan 30, 2025 · 22 comments
Closed
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
Contributor

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 [email protected] 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.

@mastazi
Copy link

mastazi commented Feb 15, 2025

Just leaving this here: if you don't want to deal with dependencies etc. just downgrading Freetube to 0.22.1 solves the issue.

EDIT however all bugs fixed since 0.22.1 will come back obviously :-) so your mileage may vary.

Having said that, If you still want to do it:

sudo flatpak update --commit 538ff3a4ae126bf7ebefed4c31777a03d50a3cca317c577b709087450c24633d io.freetubeapp.FreeTube

@Veeno
Copy link

Veeno commented Feb 16, 2025

Surely a hotfix that downgrades the shaka-player dependency can be made until a solution that works with the latest version is found? Does shaka-player 4.13 fix or introduce any essential features that would prevent a dependency downgrade from being a viable temporary fix?

@Gorrrg
Copy link
Author

Gorrrg commented Feb 17, 2025

I would suggest using the last good build 5537 without this bug instead of version 0.22.1. So the question is: Are there any essential features since 5537 you can't live without? ;)

The shaka-player bug itself has already been fixed two weeks ago. Almost immediately someone made a pull request, it just hasn't made it into any hotfix releases yet. It's planned for 4.14.0 but some bugfixes for that release have also made it into 4.13.1 and 4.13.2. So maybe soon, the list of bugfixes to be added keeps growing, so patience is advised. I just stick to the last build with shaka-player 4.12 and wait. But it's been fixed, don't worry, these things take time until they make it into releases.

@Veeno
Copy link

Veeno commented Feb 17, 2025

I would suggest using the last good build 5537 without this bug instead of version 0.22.1. So the question is: Are there any essential features since 5537 you can't live without? ;)

The shaka-player bug itself has already been fixed two weeks ago. Almost immediately someone made a pull request, it just hasn't made it into any hotfix releases yet. It's planned for 4.14.0 but some bugfixes for that release have also made it into 4.13.1 and 4.13.2. So maybe soon, the list of bugfixes to be added keeps growing, so patience is advised. I just stick to the last build with shaka-player 4.12 and wait. But it's been fixed, don't worry, these things take time until they make it into releases.

I believe it's been fixed, but what I'm suggesting is a simple temporary downgrade of the dependency version in FreeTube from ^4.13.0 to <4.13, until a version of shaka-player with the fix has been released. There's no reason users who prefer that videos don't start playing automatically should be forced to have them play automatically when the temporary hotfix is so simple, even though the bug is ultimately in shaka-player and not FreeTube itself.

@efb4f5ff-1298-471a-8973-3d47447115dc

We wont downgrade over this. Just have patience like mentioned by @Gorrrg before. Im locking this thread as there isnt value to be added to this discussion anymore as upstream fix its on its way

@FreeTubeApp FreeTubeApp locked and limited conversation to collaborators Feb 17, 2025
@FreeTubeApp FreeTubeApp unlocked this conversation Feb 22, 2025
@absidue
Copy link
Member

absidue commented Feb 22, 2025

Closed by #6868

@absidue absidue closed this as completed Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To assign
Development

Successfully merging a pull request may close this issue.