Skip to content

Commit

Permalink
Merge pull request #28 from Tom-Hirschberger/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Tom-Hirschberger authored May 23, 2023
2 parents a0962d3 + 6c86a8f commit f1aec8a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ The custom commands configuration then will look something like:
customCommandArgs: ["50", "###URL###"],
```

Both the `vlcWrapper.bash` and `vlcPaWrapper.bash` support adding additonal custom arguments that will be added to the vlc command line.
If you i.e. want vlc to ignore certificate errors while connecting to a https stream you can set the option `--http-no-ssl-verify` like in this example:

```js
customCommand: "./modules/MMM-MplayerRadio/scripts/vlcWrapper.bash",
customCommandArgs: ["###URL###","--http-no-ssl-verify"],
```

### XMMS2 ###

If you prefere xmms2 to play the radio streams instead of mplayer you will find an custom script "playRadio.bash" in the scripts folder. There is a example config in the examples directory, too.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MMM-MplayerRadio",
"version": "0.1.0",
"version": "0.1.1",
"description": "",
"main": "MMM-MplayerRadio.js",
"dependencies": {
Expand Down
12 changes: 11 additions & 1 deletion scripts/vlcPaWrapper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,23 @@ trap exit_script exit

NEW_VOLUME=$1
STREAM=$2

ADD_ARG_CNT=$(($#-2))
if [ ${ADD_ARG_CNT} -gt 0 ]
then
ADD_OPTS=${@:3:$ADD_ARG_CNT}
else
ADD_OPTS=""
fi


IDENTIFIER="video"
#FILE_PATH=`readlink -f $0`
#CUR_DIR=`dirname $FILE_PATH`
PA_VOLUME="/usr/local/sbin/pa_volume"

"$PA_VOLUME" "$IDENTIFIER" "$NEW_VOLUME"
/usr/bin/vlc -vvv -I dummy "$STREAM" vlc://quit 2>&1 &
/usr/bin/vlc -vvv ${ADD_OPTS} -I dummy "$STREAM" vlc://quit 2>&1 &
sleep 1
VLC_PID=$!
echo "PID is $VLC_PID"
Expand Down
9 changes: 8 additions & 1 deletion scripts/vlcWrapper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ exit_script() {
trap exit_script exit

STREAM=$1
ADD_ARG_CNT=$(($#-1))
if [ ${ADD_ARG_CNT} -gt 0 ]
then
ADD_OPTS=${@:2:$ADD_ARG_CNT}
else
ADD_OPTS=""
fi

/usr/bin/vlc -vvv -I dummy "$STREAM" vlc://quit 2>&1 &
/usr/bin/vlc -vvv ${ADD_OPTS} -I dummy "$STREAM" vlc://quit 2>&1 &
sleep 1
VLC_PID=$!
echo "PID is $VLC_PID"
Expand Down

0 comments on commit f1aec8a

Please sign in to comment.