Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Can I use JS to change the volume of a video in the html5 video component?

Community Beginner ,
Nov 06, 2020 Nov 06, 2020

I just want to be able to load the video component at 50% volume so I don't blow the users ears out when a video plays?

 

seems like I should be able to do that easily.  I can't find documentation ANYWHERE.

203
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 06, 2020 Nov 06, 2020

I think I am seeing the issue - I am issuing the command: this.diy1embed.volume=.25;   it works in the console but is unavailable in the movie on click or on frame - I believe its a timing issue.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 06, 2020 Nov 06, 2020
LATEST

ok all - here was the solution:

setTimeout(function(){ this.diy1embed.volume=.15; }, 200);

a 200ms delay on the volume change gave the component the time to load

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines