Git Product home page Git Product logo

fivem-hypnonema's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.