GIF alerts setup


#1

PhantomBot Version: 2.4.2
OS Version: Raspian Linux 4.14.34-v7+ (arm)
Java Version: 1.8.0_65
Browser and Version (for Panel Support): Chrome (latest)
Stock PhantomBot: Yes

Let us know what help you need:
Currently I simply want to setup some simple GIF alerts and tried to follow instructions as given here: How to Setup GIF Alerts
But following the example with additional CSS options

!addcom !command (alert money.gif,10,background:#000;top:50%)

I get following error in Chrome

Uncaught TypeError: Failed to set the 'volume' property on 'HTMLMediaElement': The provided double value is non-finite.
    at HTMLDivElement.<anonymous> (index.js:280)
    at HTMLDivElement.r.complete (jquery.min.js:3)
    at f (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at u (jquery.min.js:1)
    at ce.fx.tick (jquery.min.js:3)

Any help would be much appreciated.


#2

Okay looking through the code I think I might found how the GIF alerts are handled and how to fix my problem.

// from resources/web/alerts/js/index.js:L240
gifSettingParts.forEach(function(value, index) {
        switch (index) {
            case 0:
                gifFile = value;
                break;
            case 1:
                gifDuration = (parseInt(value) * 1000);
                break;
            case 2:
                gifVolume = value;
                break;
            case 3:
                gifCss = value;
                break;
        }
    });

That shows the Setup GIF Alerts is not up to date anymore. The settings now include the option to adjust the volume before the custom CSS.

Considering this a command with GIF alert and complete parameters would look like this:

!addcom !command (alert GIF_FILE_NAME, PLAY_DURATION, AUDIO_VOLUME, CUSTOM_CSS)

Hope I got that right but if not I would appreciate any hint to solve this the right way.