Jump to content

CEF - audio


Skream

Recommended Posts

mp3/sounds in CEF

 

        <audio id="intro" controls autoplay loop hidden=true>
            <source src="sounds/intro.mp3" type="audio/mpeg">
        </audio>
       

nothing happens in-game. It works pretty well if I open it in my browser but I get nothing ingame

 

I tried to play it with JS but still nothing happens 

 

screenW, screenH = guiGetScreenSize()
webBrowser = guiCreateBrowser(0, 0, screenW, screenH, true, true, false)
theBrowser = guiGetBrowser(webBrowser)

addEventHandler("onClientBrowserCreated", theBrowser, 
	function()
		loadBrowserURL(theBrowser, "http://mta/rio-login/index.html")
		setBrowserVolume(theBrowser, 1);
		
		showCursor(true)
		fadeCamera(false)
		showChat(false)
	end
)

this is my lua code and everything works alright except playing sounds. 

 

nothing happens with setBrowserVolume either

 

I know I can play the intro ingame k no problem about that but how can it would be hard to call a mta.trigger everytime I need to use a sound for hover or click

Edited by Skream
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...