Jump to content

how to Start Music C# !!


TimoMazzika

Recommended Posts

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

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

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

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...