Skip to content

all-in-simplicity/fivem-hypnonema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hypnonema 🎬 🎥

Media Player Resource for FiveM

GitHub Repo stars GitHub release (latest by date including pre-releases) GitHub all releases CC BY-NC-SA 4.0 GitHub issues

Hypnonema

Table of Contents

Features

  • Synchronized
  • All HTML5 supported audio and video types including HLS/DASH plus Twitch / YouTube / DailyMotion / Facebook / Vimeo / Streamable / Vidme / Wistia / SoundCloud
  • Multi-Screen capable (watch multiple movies at once)
  • 3D Spatialized Audio temporarily removed due to undergoing performance improvements
  • NUI Frontend
  • ACE-Permissions
  • Live-Edit Feature (simplifies scaleform placement)

Demo

Click me

Requirements

Installation

  1. Download the latest Release from Github and extract the zip file to your resources directory.
  2. (Optional) Edit permissions.cfg to your likings. See Permissions for more information.
  3. Edit the server.cfg and add following lines:
exec @hypnonema/permissions.cfg
start hypnonema

Permissions

By default only members of group.admin are allowed to interact with hypnonema. To permit users to make use of all available functionality make sure to edit the permissions.cfg file inside the resource directory.

Below is a list of all available permission settings.

Permission Description
hypnonema.screens.edit Allow editing existing screens
hypnonema.screens.create Allow creating screens
hypnonema.screens.delete Allow deleting screens
hypnonema.playback.play Allow playing videos
hypnonema.playback.resume Allow resuming paused videos
hypnonema.playback.repeat Allow enabling/disabling repeating of videos
hypnonema.playback.pause Allow pausing videos
hypnonema.playback.stop Allow stopping videos

Example permission config

To restrict creating / editing screens to admins only but allow everyone to control the playback use following settings.

add_ace group.admin hypnonema.screens allow
add_ace builtin.everyone hypnonema.playback allow

(Optional) Example Map

There is an example map included, just copy the folder hypnonema-map to your resource directory and paste following line into your server.cfg.

start hypnonema-map

Customization

Change command

If you want to use your own command just edit the fxmanifest.lua. Don't add preceding slashes or any special characters.

hypnonema_command_name 'mynewcommand'

Exports

Server-side

play

exports.hypnonema:play(screenName, url)

pause

exports.hypnonema:pause(screenName)

stop

exports.hypnonema:stop(screenName)

resume

exports.hypnonema:resume(screenName)

repeat

exports.hypnonema:repeat(screenName, shouldRepeat)

seek

exports.hypnonema:seek(screenName, time)

getScreenList

local screens = json.decode(exports.hypnonema:getScreenList())

createScreen

Note: The parameter has to be in JSON format.

local exampleScreen = {
    AlwaysOn = false,
    DuiBrowserSettings = {
        GlobalVolume = 100,
        Is3DAudioEnabled = true,
        SoundAttenuation = 10,
        SoundMaxDistance = 200,
        SoundMinDistance = 10,
    },
    Is3DRendered = true,
    Name = "Hypnonema Example Screen",
    PositionalSettings = {
        PositionX = -1678.949,
        PositionY = -928.3431,
        PositionZ = 20.6290932,
        RotationX = 0,
        RotationY = 0,
        RotationZ = -140,
        ScaleX = 0.969999969,
        ScaleY = 0.484999985,
        ScaleZ = -0.1,
    }
}

exports.hypnonema:createScreen(json.encode(exampleScreen))

editScreen

Note: The parameter has to be in JSON format

exports.hypnonema:editScreen(jsonScreen)

deleteScreen

exports.hypnonema:deleteScreen(screenName)

getDuiState

returns a list containing current player states.

local duiState = json.decode(exports.hypnonema.getDuiState())

License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

CC BY-NC 4.0

Support

Please use the fivem-thread for support.