Kapricioza Posted September 11, 2018 Posted September 11, 2018 Hello, I'm trying to play custom music in game using CEF, but It only works when audio is very short (less then 10s). I'm using .ogg format and this code: function playAudio() { let myAudio = new Audio("sampel.ogg"); myAudio.play(); myAudio.volume = 0.1; } Is there any limit to using custom songs?
Robson Posted September 11, 2018 Posted September 11, 2018 (edited) Hello Kapricioza 11 minutes ago, Kapricioza said: Hello, I'm trying to play custom music in game using CEF, but It only works when audio is very short (less then 10s). I'm using .ogg format and this code: function playAudio() { let myAudio = new Audio("sampel.ogg"); myAudio.play(); myAudio.volume = 0.1; } Is there any limit to using custom songs? Have you try to use myAudio.load(); before play? I already warn you that I'm not sure if still gonna work cuz chrome had some policy changes with audio. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes Edited September 11, 2018 by Robson
Kapricioza Posted September 11, 2018 Author Posted September 11, 2018 (edited) I try with myAudio.load(), but it is still not working Edited September 11, 2018 by Kapricioza
Robson Posted September 12, 2018 Posted September 12, 2018 (edited) 1 hour ago, Kapricioza said: I try with myAudio.load(), but it is still not working So the CEF build is already updated. For the best result I would suggest you to go with https://wiki.rage.mp/index.php?title=Client-side_functions#Audio Edited September 12, 2018 by Robson 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now