[JS, CEF] Internet Radio 1.0.1

   (2 reviews)
Sign in to follow this  

1 Screenshot

About This File

Internet radio over colshapes using CEF.

Scope of application: custom clubs, interiors.

Default location is the Galileo Observatory (behind the monument).

Default radio station - Wacken Radio (DE).

Installation:

I. Put server files to: server-files\packages\yourGameMode

II. Add require('./rStreamColshapes');  to your server's index.js

III. Put client files to: client_packages then edit your client's index.js and add require('./rStream');

To change radio stream url, edit index.html here: client_packages\cef\rStream\index.html

 

GitHub


What's New in Version 1.0.0   See changelog

Released

No changelog available for this version.

  • Like 2



User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest

Loxitation

   2 of 2 members found this review helpful 2 / 2 members

Hey, I've re-worked your script a little bit to fix the error that you call the radio in every colshape.

 

Serverside:

Spoiler

function playerEnterColshapeHandler(player, shape) {
    if(shape == rStreamColshape) {
        player.notify(`Radio stream started`);
        player.call("cRadio-Start", []);
    }
}
mp.events.add("playerEnterColshape", playerEnterColshapeHandler);

function playerExitColshapeHandler(player, shape) {
    if(shape == rStreamColshape) {
        player.notify(`Radio stream stopped`);
        player.call("cRadio-Stop", []);
    }
}
mp.events.add("playerExitColshape", playerExitColshapeHandler);

//Calling the CEF with player.call"cRadio[...]"

and clientside

Spoiler

let rStream = null;


mp.events.add(
{
    "cRadio-Start" : () => {
        rStream = mp.browsers.new('package://RP/Browsers/rStream/index.html');
    },
    
    "cRadio-Stop" : (lang, inject) => {
         rStream.destroy();
    },

});

 

 

I hope it helps you out 🙂

Response from the author:

It works, thank you!

  • Like 2

Share this review


Link to review
starkserwf

  

The script works, but now when entering any other collshape the radio stream is turned on. How to fix?

Share this review


Link to review