TimoMazzika Posted April 29, 2019 Share Posted April 29, 2019 Hello i'm looking for c# code that allows me to play music like int this old wiki https://wiki.gt-mp.net/index.php?title=StartMusic Link to comment Share on other sites More sharing options...
Stan9964 Posted April 30, 2019 Share Posted April 30, 2019 If you want to start a music/sound from the game you need to execute mp.game.audio.triggerMusicEvent(eventName); eventName is the name of the sound/music from the game. You can get the list of them here. If you want to play your own music you can just start that in the browser itself. Play music and hide the browser. You do not have to have the player controls and can control the HTML media player via JS. More info here. Link to comment Share on other sites More sharing options...
robearded Posted April 30, 2019 Share Posted April 30, 2019 4 hours ago, Stan9964 said: If you want to start a music/sound from the game you need to execute mp.game.audio.triggerMusicEvent(eventName); eventName is the name of the sound/music from the game. You can get the list of them here. If you want to play your own music you can just start that in the browser itself. Play music and hide the browser. You do not have to have the player controls and can control the HTML media player via JS. More info here. Reminder: Chromium Embedded Framework doesn't comes with the anility to read mp3 and some other formats by default(licenses issues) and in the current version I think George forgot to add them into the rage build. Also you may have some problems with the autoplay feature too, where the user may need to trigger a click/keypress to start the music. This can also be editet in the config for CEF but as above I'm not sure if George has done that in the current version because I saw some people complaining about it. Link to comment Share on other sites More sharing options...
Stan9964 Posted May 2, 2019 Share Posted May 2, 2019 On 4/30/2019 at 5:31 PM, robearded said: Also you may have some problems with the autoplay feature too, where the user may need to trigger a click/keypress to start the music. What if you hide the controls and trigger play with JavaScript? Link to comment Share on other sites More sharing options...
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