Media Sources

How to point to media and files, and what formats are supported.

What are media sources

OpenAudioMc is a web-first platform, meaning that everything you give it as input has to be accessible over the internet. In this case, that means that your media sources need to come from a publicly available web-page or another supported platform.

This usually comes in the form of URL's you enter within your other audio related commands or API queries.

Supported platforms

We support a handful of methods to get your media to the client. These include:

  • SoundCloud
    1. SoundCloud media must be public (so no private uploads/accounts)
    2. Some artists may not allow their content to be used on third party sites, so playback will not work in these cases
    3. Although supported, this isn't advised for production use.
  • Your own Web Server
    1. Your Web Server must have a valid domain with an SSL certificate
    2. Your Web Server must support partial content, most big vendors support this natively when serving directly from the file system
    3. Compatible file-types depend on the browsers your players use. We recommend sticking with .mp3 or .m3u for live sources
    4. Try to keep individual file-sizes below 25Mb to ensure reliability
  • YouTube links (legacy/unsupported) (handled by a third party)
    1. YouTube links may not work the first time you use them, as they have to be pre-processed before playback is available. This can take a while depending on the content length. Please Try again later if it doesn't work initially.
    2. Content may not be longer than 60 minutes, but we recommend aiming for 15 minutes max.
    3. Although supported, this isn't advised for production use.

Random media and playlists

Playlists have moved and are now their own dedicated feature. Please visit the Playlists page for more information.

Media Options

Media playback behaviour can be configured through Media Options. These can be used in some commands in the form of a JSON string, or as a MediaOptions object through the API.

It supports the following properties

  • fadeTime (Integer): Time for the sound to fade in (in MS)
  • id (String): A manual ID/reference to the newly started media. Can be used to stop/edit this media later on
  • loop Boolean: A boolean flag that indicates if this media should loop when it finished (true/false), default is false.
  • pickUp Boolean: A boolean flag that indicates if the client should attempt to synchronize with other listeners. Default is false.
  • expirationTimeout Integer: Media is normally only started for players who have their client open at the time the command is sent. With this timeout, you can make OpenAudioMc wait a given amount of time (in seconds), after which the media will still play for a client even if they connected a bit later.
  • volume Integer: The volume (from 0 to 100%) at which the media should be played. This is still relative to the users own volume slider. (Default value is 100)
  • muteRegions Boolean: This will mute all regions for the player while this sound is playing. (Default value is false)
  • muteSpeakers Boolean: This will mute all speakers for the player while this sound is playing. (Default value is false)

    A full media flags object might look a little like this

Note that the JSON may never include spaces or line breaks.

An example of a file for everyone in a region, that would overwrite regions and speakers could look like this

/oa play @a[region=showarea] {muteRegions:true,muteSpeakers:true,id:"my-show"}

Javadoc related to this feature (currently based on the dev branch)