How do I make the video autoplay, with sound?

Discussion in 'Programming' started by umustbeloggedintododat, Apr 2, 2021.

  1. umustbeloggedintododat

    umustbeloggedintododat
    Expand Collapse

    Joined:
    Feb 16, 2019
    Messages:
    1,381
    So I'm trying to make a video thing in a car, I can get it to autoplay, but when I try to get it to autoplay with sound it doesn't want to play. Can this be fixed? Is it some limitation?
    Here's the html:
    HTML:
    <html ng-app="gaugesScreen">
    <head>
      <meta charset="UTF-8">
      <script src="../../../ui/lib/ext/angular.min.js"></script>
      <script src="gauges_screen.js"></script>
      <link type="text/css" rel="stylesheet" href="gauges_screen.css">
    </head>
    
    <body>
    <iframe width="500" height="240"
    src="https://www.youtube.com/embed/2PZzLMe-fV8?autoplay=1&mute=0">
    </iframe>
    </body>
    
    </html>
    (Replace gauges_screen.html with this)
     
  2. angelo234

    angelo234
    Expand Collapse
    Programmer
    BeamNG Team

    Joined:
    Aug 11, 2017
    Messages:
    540
    This is just an idea but maybe you could somehow download the audio WAV file of the video and then play it using:
    Code:
    Engine.Audio.playOnce('AudioGui', 'audio.wav')
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice