Skip to main content
Inspiring
March 6, 2023
Answered

Pre-setting the volume level of a webpage <video>

  • March 6, 2023
  • 3 replies
  • 414 views

Is there a non-js way to pre-set the volume slider in a <video>? Nothing against js, my site just randomly happens to be js-free so I'm trying to keep the streak alive, not a big deal if that streak ends here. (Unless it can be done through PHP, which the site does use?)

 

Basically, I'm just looking to make sure no one's volume slider is at 100% when the video starts, by pre-setting it to 70%. Not a big deal, more of a nice-to-have than a need.

 

Thanks!

    This topic has been closed for replies.
    Correct answer Nancy OShea

    If audio track is obnoxiously loud, you need to fix that in the native video file before it's transcoded to MP4.

     

    3 replies

    Nancy OShea
    Community Expert
    Community Expert
    March 7, 2023
    quote

    ...my site happens to be js-free so I'm trying to keep the streak alive... (Unless it can be done through PHP, which the site does use?)


    By @Under S.

    =========

    Why avoid it?  PHP and JavaScript are not mutually exclusive.  But they are two different languages with a different purpose in web development.  PHP is a server-side language that executes scripts on the server.  JavaScript is a client-side language that executes in the user's browser.  Most dynamic websites use both -- PHP for heavy lifting and JavaScript for interactivity and to create a better user experience. 

     

     

    Nancy O'Shea— Product User & Community Expert
    Nancy OShea
    Community Expert
    Nancy OSheaCommunity ExpertCorrect answer
    Community Expert
    March 7, 2023

    If audio track is obnoxiously loud, you need to fix that in the native video file before it's transcoded to MP4.

     

    Nancy O'Shea— Product User & Community Expert
    Under S.Author
    Inspiring
    March 8, 2023

    Thanks. That's pretty much what I ended up doing when I found out there's no easy HTML toggle like there is for mute.

    Nancy OShea
    Community Expert
    Community Expert
    March 7, 2023

    No.  Volume is a user setting.   However, you can MUTE audio if you need to.

     

    <video controls="controls" muted="muted"  etc.... >

     

     

     

    Nancy O'Shea— Product User & Community Expert