• Stars
    star
    107
  • Rank 321,969 (Top 7 %)
  • Language
    JavaScript
  • Created almost 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Synchronized media player for FiveM and RedM

pmms - FiveM/RedM synchronized media player

pmms (Poodle's MultiMedia System) allows players to play music/video from entities such as phonographs, radios or TVs.

Features

  • NUI-based, using MediaElement.js to support HTML5 media, HLS, YouTube, and more.

  • Synchronized between players.

  • Multiple entities can play different things at the same time.

  • Dynamic sound attenuation based on whether the player and entity are in the same interior room.

  • Optional immersive filter can be applied to any audio.

  • Play video on a TV screen or scaleform with DUI (FiveM), or on a screen displayed above the entity (RedM).

  • Play audio inside or outside of vehicles.

  • Permissions system and ability to lock entities so only certain players can control them.

  • Configure default entities which are spawned and play music/video automatically.

  • Audio visualizations via Wave.js.

Examples

Attenuation Example Phonograph Filter Video
FiveM basic audio FiveM DUI example DUI render target proximity
Audio Visualizations Vehicle modes Scaleform adjustment

Dependencies

Installing

  1. Install all dependencies.

  2. Place the files from this repository in a new folder in your resources directory.

    Example: resources/[local]/pmms

    Note

    The name of the resource must be in all lowercase in order for it to function properly. This is due to how NUI callbacks work.

  3. Add the following in server.cfg:

    exec @pmms/permissions.cfg
    start pmms
    

Permissions

The default permissions allow members of group.admin full access to pmms, while other players will only be able to perform basic interactions with media players and only be able to play preset songs (those defined in Config.presets in config.lua).

To allow all players to be able to play custom URLs, in permissions.cfg, uncomment or add the following line:

add_ace builtin.everyone pmms.customUrl allow

Even with this ace, URLs will be restricted to those allowed by Config.allowedUrls, which includes generally safe sites such as YouTube. To allow players to use URLs from other sites, you can either add the appropriate pattern to Config.allowedUrls, or uncomment or add the following line to remove the restriction entirely:

add_ace builtin.everyone pmms.anyUrl allow

Keep in mind that media played with pmms is loaded individually by all players, meaning each player will be accessing the URL from their own connection. Therefore, allowing any player to play a random URL can present some risk of exposing players' IP addresses to an attacker playing something from their own web server and logging the connections.

Commands

Note

The command names can be customized. These are the defaults.

Command Description
/pmms Open the media player control panel.
/pmms_play [url] ... Play music/video on the nearest media player.
/pmms_pause Pause playback on the nearest media player.
/pmms_stop Stop playback on the nearest media player.
/pmms_status Show the status of the nearest media player.
/pmms_presets List presets.
/pmms_vol [volume] Set a personal base volume for all media players.
/pmms_fix Reset your client, which may fix certain issues.
/pmms_ctl Advanced media player control.
/pmms_add Add or modify a media player model preset.
/pmms_refresh_perms Refresh permissions for all clients.

Exports

Server-side

startByNetworkId

handle = exports.pmms:startByNetworkId(netId, options)

Starts playing something on a networked media player entity, using its network ID.

Media player options

options is a table of options for the new media player.

Option Description
url The URL of the media to play.
title The title of the media to display.
volume The volume of the new media player. Default: 100.
offset The time to start the media at in seconds. Default: 0.
duration The duration of the media. nil, false or 0 will treat the media as a live stream.
loop Whether to loop the media. Requires a duration.
filter Whether to apply the immersive filter to the media player.
locked Whether to lock the media player.
video Whether to display NUI video (RedM only).
videoSize The size of the NUI video screen (RedM only).
muted Whether the media player is muted by default.
attenuation The attenuation multipliers for the media player.
diffRoomVolume Difference between the base volume in the same room and a different room.
range The range of the media player.
visualization The audio visualization to apply to the media player.

startByCoords

handle = exports.pmms:startByCoords(x, y, z, options)

Starts playing something on a non-networked media player entity, using its coordinates on the world map.

For options, refer to Media player options.

startScaleform

handle = exports.pmms:startScaleform(scaleform, options)

Starts playing something on a standalone scaleform screen.

For options, refer to Media player options.

Scaleform options

scaleform is a table of options for the scaleform screen.

Option Description
name The name of the scaleform (.gfx filename minus extension).
position A vector3 for the coordinates of the top-left of the screen.
rotation A vector3 for the orientation of the screen.
scale A vector3 for the scale of the screen.

stop

exports.pmms:stop(handle)

Stops a media player and removes its handle.

pause

exports.pmms:pause(handle)

Pause or resume a media player.

lock

exports.pmms:lock(handle)

Locks an active media player so that only privileged users can interact with it.

unlock

exports.pmms:unlock(handle)

Unlocks an active media player so anyone can interact with it.

mute

exports.pmms:mute(handle)

Mutes an active media player.

unmute

exports.pmms:unmute(handle)

Unmutes an active media player.

Client-side

enableEntity

exports.pmms:enableEntity(entity)

Allows the player to use a particular entity if they do not have the pmms.anyEntity ace.

disableEntity

exports.pmms:disableEntity(entity)

Disables the use of this entity for a player without the pmms.anyEntity ace.

createMediaPlayer

entity = exports.pmms:createMediaPlayer(options)

Creates a new networked entity which the player can use as a media player.

createMediaPlayer options

Option Description
model The entity model to use. If omitted, Config.defaultModel will be used.
position A vector3 for the coordinates where the entity will be spawned.
rotation A vector3 for the orientation of the entity.

deleteMediaPlayer

exports.pmms:deleteMediaPlayer(entity)

Deletes an entity created by createMediaPlayer.

More Repositories

1

spooner

Entity spawner for FiveM and RedM
Lua
55
star
2

s1kd-tools

A set of small, free and open source software tools for manipulating S1000D data.
C
30
star
3

httpmanager

HTTP handler library for FiveM and RedM
Lua
24
star
4

webmap

Live map for FiveM and RedM servers
JavaScript
18
star
5

redm-interactions

Interact with objects in RedM
Lua
18
star
6

redm-uiprompt

Library for creating and using UI prompts
Lua
15
star
7

redm-objectloader

Map Editor XML loader for RedM
Lua
12
star
8

weathersync

Weather and time sync for FiveM and RedM
Lua
12
star
9

redm-freecam

FreeCam script for RedM
Lua
11
star
10

redm-emotes

Configurable emote system for RedM
Lua
11
star
11

fivem-scenarios

Lets players use nearby ped scenarios
Lua
11
star
12

discord_rest

Discord REST API utility for FiveM and RedM
Lua
11
star
13

1436chan

Gopher textboard
Shell
10
star
14

redm-xmas

Christmas map for my RedM server
Lua
9
star
15

poodlechat

Chat resource for Poodle's Palace FiveM/RedM server
Lua
8
star
16

redm-uifeed

Exports for using the UIFEED natives
JavaScript
7
star
17

redm-ipls

IPL list used on Poodle's Palace
Lua
7
star
18

redm-instruments

Play instruments in real time with other players
JavaScript
7
star
19

lambda2ymap

Convert Lambdarevolution map editor maps to ymap
XSLT
7
star
20

popdensity

FiveM/RedM population density control script
Lua
7
star
21

redm-undead

Replace human peds with the undead
Lua
7
star
22

redm-carry

Carry entities
Lua
6
star
23

bucky

Bucktooth HTTP proxy
C
6
star
24

redm-ballooncontrols

Controls for the hot air balloon in RDR2
Lua
6
star
25

redm-tags

Overhead player name/entity ID tags
Lua
5
star
26

redm-doorsearch

Lua
5
star
27

redm-sidesaddle

Ride side-saddle on horses
Lua
5
star
28

s1000d-html-stylesheet

S1000D HTML stylesheet
XSLT
5
star
29

redm-mount

Mount interactions
Lua
4
star
30

S1000D

Sample S1000D CSDB
Makefile
4
star
31

s1kd-flowchart

S1000D fault isolation procedure flowchart generator
XSLT
4
star
32

redm-ball

Throwable balls
Lua
4
star
33

s1kd-viewer

S1000D IETP viewer
XSLT
4
star
34

discord_roles

Automatically add players to principals based on their roles in a Discord guild
Lua
4
star
35

redm-doors

List of doors to unlock
Lua
4
star
36

redm-rcboat

Spawn an RC boat you can control with the arrow keys
Lua
4
star
37

callbacks

Network callbacks library for FiveM and RedM
Lua
3
star
38

redm-noclip

NoClip script for RedM
Lua
3
star
39

redm-blips

Blips for players, entities and locations
Lua
3
star
40

pmms-dui

DUI page for pmms
JavaScript
3
star
41

ste-dic

Simplified Technical English (STE) dictionaries
3
star
42

logmanager

FiveM/RedM event logger
Lua
3
star
43

vim-s1000d-omnicomplete

Vim Omnicomplete dictionaries for S1000D
Vim Script
3
star
44

redm-pvp

Script to toggle PvP on/off for a player
Lua
3
star
45

redm-iplsearch

Utility for finding nearby IPLs
Lua
3
star
46

custom_hud

Custom HUD textures for the Poodle's Palace FiveM server
Lua
3
star
47

s1kd-tools-npp-pythonscript

Notepad++ PythonScript interface for the s1kd-tools
Python
3
star
48

redm-fixanimals

Fixes controls when using an animal ped
Lua
3
star
49

redm-scalesync

Synchronizes custom scales for player peds
Lua
2
star
50

credits

Show credits for resources on a FiveM or RedM server
JavaScript
2
star
51

shcgi

CGI utilities for POSIX shell
Shell
2
star
52

s1kd2db

S1000D to DocBook 5 stylesheet
XSLT
2
star
53

fivem-xmas

Lua
2
star
54

redm-notifications

Simple pop-up notifications
Lua
2
star
55

redm-events

Functions for events on the Poodle's Palace server
Lua
2
star
56

resourcemanager

Resource manager for FiveM and RedM
Lua
2
star
57

fivem-custom-blips

Let's players choose a blip colour which is synced and saved between sessions
Lua
2
star
58

redm-ragdoll

Ragdoll resource used on Poodle's Palace
Lua
2
star
59

redm-respawn

Manual respawn/revive script for RedM
Lua
2
star
60

libxpath2

XPath 2.0 implementation for libxml2
C
2
star
61

s1kd-tools-doc

Example S1000D publication produced with s1kd-tools and S1000D-XSL-Stylesheets
XSLT
2
star
62

redm-eagleeye

Enables Eagle Eye
Lua
2
star
63

Gopher-CAPTCHA

A CAPTCHA system for Gopher
Shell
2
star
64

discord_rich

Discord rich presence resource used on Poodle's Palace
Lua
2
star
65

redm-lightning-attacks

Summon a bolt of lightning wherever you shoot
Lua
2
star
66

SynchroVideo

Synchronised video web service
Oxygene
2
star
67

playermanager

FiveM/RedM player manager
Lua
2
star
68

server-scenarios

Custom scenarios for FiveM, replacing alamo sea, downtown, farmers market, sandy shores, senora hill, and stables (Martin Madrazo's Ranch)
Lua
1
star
69

s1kd-process2sh

Convert S1000D process data modules to interactive shell scripts
XSLT
1
star
70

db2s1kd

DocBook-to-S1000D stylesheet
XSLT
1
star
71

s1000d-serna-templates

S1000D document templates for Syntext Serna
XSLT
1
star
72

Asciidoctor-S1000D-converter

Asciidoctor converter for S1000D
Ruby
1
star
73

redm-props

Prop emotes
Lua
1
star
74

redm-coreupgrades

Core upgrades resource on Poodle's Palace
JavaScript
1
star
75

server_restart

Restart announcement script used for Poodle's Palace
Lua
1
star
76

redm-guarma

RedM script to automatically toggle the world between normal and Guarma settings
Lua
1
star
77

xml-utils

General XML utilities
C
1
star
78

fpGopher

Gopher tools written for Free Pascal
Pascal
1
star
79

fbos

FizzbuzzOS
C
1
star
80

FOSSIG

S1000D Free Open Source Software Interest Group
Makefile
1
star
81

phtools

Tools for creating dynamic gopher menus
Shell
1
star
82

redm-moonshineshacks

Moonshine shack imaps, interiors, teleporters and blips for RedM
Lua
1
star
83

xml-utils-npp-pythonscript

xml-utils PythonScript interface for Notepad++
Python
1
star
84

redm-flintlock

Equip a flintlock pistol
Lua
1
star
85

redm-handsup

Raise hands script for RedM
Lua
1
star