Coder Social home page Coder Social 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.

fivem-hypnonema's People

Contributors

all-in-simplicity avatar dazepelin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fivem-hypnonema's Issues

Crash

Client is crashing with bellow error, it is repeated multiple times

[    174688] [    DumpServer]                 5268/ Process crash captured. Crash dialog content:
[    174703] [    DumpServer]                 5268/ Oшибка (Error)
.ClientScript+<OnTick>d__31.MoveNext () [0x00022] in W:\Development\fivem-hypnonema\Hypnonema\src\Hypnonema.Client\ClientScript.cs:750 
[    174719] [    GTAProcess]             MainThrd/ 
[    174719] [    DumpServer]                 5268/ Unhandled exception in Mono script environment: System.Exception: Native invocation failed.

[    174734] [    GTAProcess]             MainThrd/ Failed to run a tick for ClientScript: System.NullReferenceException: Object reference not set to an instance of an object.

\client\clrcore\NativesFive.cs:48575 

[    174750] [    DumpServer]                 5268/   at CitizenFX.Core.Native.API.DestroyDui (System.Int64 duiObject) [0x00000] in C:\gl\builds\edf06b9b\0\cfx\fivem\code\client\clrcore\NativesFive.cs:48551 

[    174750] [    GTAProcess]             MainThrd/   at Hypnonema.Client.Players.VideoPlayerPool+<OnTick>d__13.MoveNext () [0x00034] in W:\Development\fivem-hypnonema\Hypnonema\src\Hypnonema.Client\Players\VideoPlayerPool.cs:131 

[    174766] [    DumpServer]                 5268/   at Hypnonema.Client.Graphics.DuiBrowser.Dispose () [0x00008] in W:\Development\fivem-hypnonema\Hypnonema\src\Hypnonema.Client\Graphics\DuiBrowser.cs:63 

[    174766] [    DumpServer]                 5268/   at Hypnonema.Client.Graphics.DuiBrowser.Finalize () [0x00000] in W:\Development\fivem-hypnonema\Hypnonema\src\Hypnonema.Client\Graphics\DuiBrowser.cs:25 
[    174781] [    DumpServer]                 5268/   at CitizenFX.Core.Native.API.InternalDestroyDui (System.Int64 duiObject) [0x00065] in C:\gl\builds\edf06b9b\0\cfx\fivem\code\client\clrcore\NativesFive.cs:48575 

[    174797] [    DumpServer]                 5268/   at CitizenFX.Core.Native.API.DestroyDui (System.Int64 duiObject) [0x00000] in C:\gl\builds\edf06b9b\0\cfx\fivem\code\client\clrcore\NativesFive.cs:48551 

[    174813] [    DumpServer]                 5268/   at Hypnonema.Client.Graphics.DuiBrowser.Dispose () [0x00008] in W:\Development\fivem-hypnonema\Hypnonema\src\Hypnonema.Client\Graphics\DuiBrowser.cs:63 

[    174828] [    DumpServer]                 5268/   at Hypnonema.Client.Graphics.DuiBrowser.Finalize () [0x00000] in W:\Development\fivem-hypnonema\Hypnonema\src\Hypnonema.Client\Graphics\DuiBrowser.cs:25 
[    174844] [    DumpServer]                 5268/ 
[    174859] [    DumpServer]                 5268/ This is a fatal error because game unloading failed. Please report this issue and how to cause it (what server you played on, any resources/scripts, etc.) so this can be solved.

ui not showing

guys help it says showing hynonema window but the ui not showing and i didnt got any error

Native Handler Error

image
Seem to be having this issue, when I try to play anything, I've tried both opening all ports as well as running it on my GoDaddy Host Provider, same thing both times.

Mature Audience (Twitch)

Currently, right now, it appears that Twitch has recently updated its protocols, and all of a sudden we cannot watch any streams that are regarded as mature audience streams. I have tinkered with it a bit, but can't seem to find a way around this issue.

Logging in to web platforms

It is nice to watch free YouTube videos and all, but could there be a way to log into platforms, and watch stuff like Netflix, or Hulu? Or even purchased videos/movies on YouTube?

An option could be to have a config file, which would allow someone to put in login credentials, and the resource authenticates it based on whichever platform it is.

Images

Hey there,

There is a problem with images. I changed the image sources but it looks like still the same images. The pictures have not changed.

Regards,
HRGalahad

Failed to construct 'URL' : Invalid URL

Hello,

I seen I got these error from few hours (doesn't know the exact moment when it started to spawn)

image

They are spamming something like 10 per seconds, and seem to come from the gh-pages/index.html:41

Actually, the script is still working perfectly, but keeping it active block me from reading the debugs line in the console

These line appear client side, from the start of the server, and continue while playing videos, and even after finished it
(maybe because we have multiple screen)

Command Problem

Hello
I registered my steam ID for permission in the server cfg but when i join my server I cant do /hyponema
It just prints /hyponema on the chat. I didnt edited anything in the ressource (except from moving fxmanifest into the right place)
Pls Help

Failed to read currentTime

imagen
I have this message spamming all day on the command line and that bothers to see other errors.
If it can be disabled in any way it is appreciated

Thanks for all,

Add more support website?

Could anyone please give me a hint on how I can add more website support myself? I have read the codes for a day and I still have no clue.

Feature Request

Can you please compile the new version, i'll try it many time but i can't get the environment to run.

Thx for this amazing script "Weiter so ;)"

Twtch stream unavailable due "not supported browser"

I just tested it for forst time everything works well but no twitch, it is like hypnonema do every that it should do accordly but tehre is some is not taking in count, maybe video format? any way a image worth more than 1000 words:

imagen

WIth this feature fixed it would be just wonderfull. Great work!

html call function

Third party player transmission function
I want to use ovenplayer.

However, it is not supported.
Is there any way to send the .html link?
As the distance increases
You should be able to call about:blank.

Change resourcename

Can't change the resource name to the xxx_xxxx format. After doing so the NUI refuses to close or create a new screen. When changing it back to hypnonema it works again.

Not working for other player

Hello,
the script work for me perfectly, but when some other player(s) are near they only hear the sound and when to video is on pause see HYNONEMA image.

People who join later then the video has started cannot see anything

Hi There, I tried to pull a request but meh GitHub?!

Anyway, if someone joins the server after the screen content has been started they get a black screen, my quick and dirty solution now is going to the settings pane of a screen to change nothing and save it. That makes it reload and continuing from the same play head position. Then new joined people get to see and hear stuff.

But can you maybe make it so that the screen's automatically do that or similar trick? Or any other method or solution to solve this? It's kinda too bad that peeps don't see or hear a thing when they join, since we use some hidden screens for music! ;-).

Ty!

Exception loading assembly CitizenFX.Core.Server: System.IO.FileNotFoundException: Unable to find the specified file.

Hello,

First of all, thank you very much for sharing this script. It looks very awesome and cant wait to use it on my server.

Now I ran into some trouble. You can see below the error I have server side :

Creating script environments for hypnonema
Loaded Hypnonema.Server.net, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_745035506
Exception loading assembly CitizenFX.Core.Server: System.IO.FileNotFoundException: Unable to find the specified file.

Server stack trace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR (System.Int32 errorCode) [0x0000a] in :0
at (wrapper cominterop) CitizenFX.Core.IScriptHost.OpenHostFile(string)
at (wrapper cominterop-invoke) CitizenFX.Core.IScriptHost.OpenHostFile(string)
at CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile (System.String fileName) [0x00000] in /src/code/client/clrcore/MonoScriptRuntime.cs:310
at (wrapper remoting-invoke-with-check) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile(string)
at (wrapper xdomain-dispatch) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile(object,byte[]&,byte[]&,string)

Exception rethrown at [0]:
at (wrapper xdomain-invoke) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile(string)
at CitizenFX.Core.InternalManager.LoadAssemblyInternal (System.String name) [0x00000] in /src/code/client/clrcore/InternalManager.cs:141
Exception loading assembly server/Hypnonema.Server.net: System.Reflection.ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at CitizenFX.Core.InternalManager.CreateAssemblyInternal (System.String assemblyFile, System.Byte[] assemblyData, System.Byte[] symbolData) [0x00076] in /src/code/client/clrcore/InternalManager.cs:96
at CitizenFX.Core.InternalManager.LoadAssemblyInternal (System.String name) [0x0009f] in /src/code/client/clrcore/InternalManager.cs:164
Started resource hypnonema

I tried to run your script on a linux fivem server, I dunno if it's change anything or not.
Here is the screenshot of my client console :
https://cdn.discordapp.com/attachments/608365470222909450/625385312134103090/hypnonema.png

When I run the command in the chat nothing happened. No new errors either on the client nor server side.

[FEATUREREQUEST] Exports to use hypnonema as dependency

Hi!

First of, I greatly appreciate this amazing script that you've created.

I've been using hypnonema for quite a while, and here's a few things that I would like to request if you find it viable and time worthy.

Exports

If there were hooks that could be used with the native exports function, I would feel like it would be of great use. Here's a few hooks that I thought of.

Serverside exports

Get, Create, Play and Stop

  • Having the ability to get the list of created screens from serverside would allow devs and server-owners to create their own UI and allow certain screens to be interactive based not only by ACE permissions but physical location of players / custom data (jobs etc).

Clientside exports

Set Local Volume

  • Different players have different output volume settings and hardware. Giving them the ability to filter their volumes down or up locally that scales with the global volume would help in overall experience when using hypnonema.

Get Visible/Active/Playing Screen in scope

  • Having the ability to get the active screen in scope and its metadata would allow devs/server owners to process screen data within the client runtime. I am sure there are many amazing things that people will come up with this. A very simple example would be showing the video name on the screen when a player enters the scope of a video.

Ability to Poster URL per screen

  • Depending on what the screen is used for, a dev/server owner might want to display different post urls for different screens. Having an individual poster url per screen as an optional field would be useful. If not set, the default poster image url should show. If this is possible, having the feature to set poster image by exports on serverside should work too!

Audio only feature

  • Along with the above exports, I believe an audio only feature would serve a great purpose too, while improving performance on certain use cases. Sometimes, a video is not needed. Of course, one could hide the screen by creating a very small 3d rendered screen somewhere, but having to do that is overkill. Setting a certain vector3 coordinate and having sound emit from there would be an amazing feature for people who only need audio on certain areas.

Thank you for your time :D

release 1.2

Hallo. Just i dropped to my server? and i change hypnonema url? Dont work for me :(

sync for other player

Thank for script. But video dont sync with other players. It is possible or it is only if we have standalone web server?

thank you.

Nginx RTMP not working

So, i setup Docker with nginx trmp and i am able to stream to it with OBS. I can also wathc my stream from VLC then.

But unable to see it with Hypnonema. It fails to read currentTime.

Would be amazing to see a tutorial on how to stream a video using RTMP

Errors....................

image

Not sure whats going on doesnt do anything in game. Before it would throw a bunch of .json errors in chat box..

Handy feature?

Would love to see a quick play button, start a favourite video link on one or multiple preset screens with just one click… could that be done?!

Sound problem

Some props like xs_prop_arena_bigscreen_01 or ba_prop_club_screens_01 generate the video well but without the sound, any idea how to have the sound as well?

custom splash

I have to say, this one has me feeling dumb.

How on earth do you set a custom splash screen?

ive set it to a new image but its not changing

it did not work

Couldn't load resource hypnonemamaster from resource /hypnonemamaster/.

Scaleform not working :(

Hey, when I start a YouTube video, it doesnt show up anything.

image

When I enter to my 'hypnonema_url', it show the curtains with no problems..

Any help? :(

Errors started after not being used for a while

I didnt use hypnonema for a while and today i wanted to use it. I updated to the last release. Getting these errors on F8 Console.

Dont know why.

Image

Sometimes its playing (rarely). But i cant see it on status page if video is playing.

Showing up on random player screens

When using this, when a movie is started on a render texture, sometimes the video will show up on random player screens upside down. Even people who are nowhere near the render texture. In a server of 32 people, this happened to 10 of them at the same time.

Global Volume, How about Self Volume?

first.
everyone like different sound volume, and everyone will heared different volume defined by thier audio card/speaker/headphone
so maybe only the settings name "Global Volume" is not a good idea

second.
in public server must be have some badboy tried to delete screens, so will disabled edit/delete screens json post code in es2015.js or other way to anti this happend.
however the global volume is setting on screens detail, so when different player have different like volume, they can't change it too, but the most important for fix this problem,add a self volume control, then every player can setting a like sound volume.

i tried add this function by my self, but the js code was be minifed....
everytime i trying to format that to normal file for easy edit code, will happend much js error....
so even i remove json post code, i was edited when minifed environment, that was hell.

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.