Live data from Hacker News

Chrome does not have any way to stop video auto play?

news.ycombinator.com

31–40 of 64 posts

Re: Chrome does not have any way to stop video auto play?

#32

Maybe they don’t want you to do that? YouTube has "autoplay next video" by default and you can’t disable that either. This is the kind of controlling behavior that I expect from Google.

> you can’t disable that either

You can though?

Re: Chrome does not have any way to stop video auto play?

#33
post #21
post #7

Earlier quoted context omitted.

The YouTube video page comes to mind e.g https://youtu.be/8aIyHl5qP9I It would me great if the user had the option to press play to start the video.

wut? You go to a YouTube video url to watch the video.

It would be nice to read the title and look at the thumbnail to get an impression before blasting "never gonna give you up" through my speakers.

Re: Chrome does not have any way to stop video auto play?

#34
post #21
post #7

Earlier quoted context omitted.

The YouTube video page comes to mind e.g https://youtu.be/8aIyHl5qP9I It would me great if the user had the option to press play to start the video.

wut? You go to a YouTube video url to watch the video.

Yep, and I'm ready to watch said video as soon as I press the play button.

I haven't really used chrome much in years, as Firefox is my main browser. But even with Firefox, stopping autoplay seems to be an ongoing cat and mouse game.

Re: Chrome does not have any way to stop video auto play?

#35
post #31

Chrome is not there to serve you. It is to serve Google.

I have said it before and I will say it again, it makes zero sense to browse the internet with a piece of software written by an advertising company.

To think, they have advocated over the years to keep adding to the specs to the point that they’ve become so complex that even Microsoft, the king of this rube goldberg type shit, threw in the towel and said eff it, we’ll just use Chromium.

We should write an app browser with sensible layout and a qemu virtual machine backend. Pay the 5% hit to run actually performant native code that’s 100% sandboxed.

Couldn’t be any worse, that’s for sure.

Re: Chrome does not have any way to stop video auto play?

#36
post #21
post #7

Earlier quoted context omitted.

The YouTube video page comes to mind e.g https://youtu.be/8aIyHl5qP9I It would me great if the user had the option to press play to start the video.

wut? You go to a YouTube video url to watch the video.

If I say "no auto-playing videos" then I mean No Auto-Playing Videos.

I don't expect you or my browser to start second guessing that with "oh, but probably it's OK on this site...?"

I do recall a Firefox discussion about how they can't 100% block videoes because there will always be another way - eg do animated gifs count, or javascript that shows a rapid sequence of images - but just because it can't be perfect doesn't mean it isn't worth doing.

Re: Chrome does not have any way to stop video auto play?

#37
post #22

Firefox blocks auto playing videos with sound by default. And you can also configure it to block all autoplay or or allow it globally, or per-website. https://support.mozilla.org/en-US/kb/block-autoplay

Using this since I can remember. But noticed another issue and still searching how to disable the video cache at all until I start to play the video and to limit it to 2-5 seconds (or 1 MB) during playing, though no chance so far.

For youtube there is a "YouTube no Buffer"[0] extension that does precisely this - stops videos from autoplaying and buffering when you open a link.

I have this plugin, Leechblock and ublock filters (blocking any mention of shorts from the site) to make yt less addicting. And it kinda works.

0 - https://addons.mozilla.org/en-US/firefox/addon/youtube-no-bu...

Re: Chrome does not have any way to stop video auto play?

#38
I made a small ViolentMonkey script to stop autoplay on Youtube, which is really annoying

    // ==UserScript==
    // @name        YouTube video page AutoPause
    // @namespace   https://greasyfork.org/en/users/13981-chk1
    // @description Automatically pause YouTube videos on Youtube video pages
    // @icon        https://www.youtube.com/s/desktop/536ed9a8/img/favicon_96x96.png
    // @include     https://*.youtube.com/watch*
    // @include     http://*.youtube.com/watch*
    // @version     0.3
    // @grant       none
    // @run-at      document-end
    // ==/UserScript==
    
    (function () {
        'use strict';
        /**
         * Get element with selector and call callback with it.
         * @param {string} selector Selector for the element.
         * @param {function} callback Callback function to call with the element.
         */
        function forElement(selector, callback) {
            // Init forElement.timeoutCount.
            if (forElement.timeoutCount === undefined) {
                forElement.timeoutCount = {}
            }
            // Init forElement.timeoutCount[selector].
            if (forElement.timeoutCount[selector] === undefined) {
                forElement.timeoutCount[selector] = 0
            }
    
            // Get element.
            const element = document.querySelector(selector)
    
            // If element not found.
            if (element === null) {
                // try again after timeout.
                setTimeout(
                    function () {
                        forElement(selector, callback)
                    },
                    (
                        // Base timeout.
                        100
                        *
                        // Increase timeout after each try.
                        (forElement.timeoutCount[selector]++)
                    )
                )
            }
            // If element found
            else {
                // reset timeout count
                forElement.timeoutCount[selector] = 0
                // and call callback with element.
                callback(element)
            }
        }
    
        // Init previous video ID.
        let videoIdCurr = null;
    
        // Init paused video ID.
        let videoIdPaused = null
    
        // Init video element.
        let videoElement = null
    
        /**
         * On playing event.
         */
        function onPlaying() {
            // If video ID has not changed from last paused one
            if (videoIdPaused === videoIdCurr) {
                // just return.
                return
            }
    
            // Pause video
            videoElement.pause()
    
            // Update paused video ID.
            videoIdPaused = videoIdCurr
        }
    
        /**
         * Run on url change.
         */
        function onUrlChange() {
            // Get video id from url.
            const videoIdNew = (new URLSearchParams(window.location.search)).get("v");
            // If
            if (
                // did not get video id
                videoIdNew === null
                ||
                // or video id did not change
                videoIdNew === videoIdCurr
            ) {
                // just return.
                return
            }
    
            // Update previous video id.
            videoIdCurr = videoIdNew;
    
            // Run for
            forElement(
                // video element that has src attribute
                "video[src]",
                function (video) {
                    // If video element is set
                    if (videoElement) {
                        // remove event listener from video element.
                        videoElement.removeEventListener("playing", onPlaying);
                    }
    
                    // Update video element.
                    videoElement = video
    
                    // Add event listener to video element
                    videoElement.addEventListener("playing", onPlaying);
                }
            )
        }
    
        // Add event listener for
        window.addEventListener(
            // Youtube page data updated event.
            'yt-page-data-updated',
            function () {
                onUrlChange();
            }
        );
    
        // Run on url change once on first load.
        onUrlChange();
    })();

Re: Chrome does not have any way to stop video auto play?

#39

Firefox blocks auto playing videos with sound by default. And you can also configure it to block all autoplay or or allow it globally, or per-website. https://support.mozilla.org/en-US/kb/block-autoplay

Which is great for most stuff, but doesn't seem to stop facebook 'reels' from animating. They must do some trickery like loading a short animated image as a 'teaser' before rendering the actual video on click.

Re: Chrome does not have any way to stop video auto play?

#40
post #31

Chrome is not there to serve you. It is to serve Google.

I have said it before and I will say it again, it makes zero sense to browse the internet with a piece of software written by an advertising company.

okay there are some reasons ...
Post reply on HN