#!/bin/bash
case $(uname -s) in
Darwin)
	VLC_BINARY="/Applications/VLC.app/Contents/MacOS/VLC"
;;
*)
	VLC_BINARY=$(which vlc)
;;
esac

VLC="${VLC_BINARY} --intf=rc --sout-ffmpeg-strict=-2"
CHANNELS=""

case $1 in
ard|ARD)
	PLAYLIST=http://wdr_ios_fsev_geo-i.akamaihd.net/hls/live/201764/1/playlist1x.m3u8
	$VLC $PLAYLIST --sout '#standard{mux=ts,dst=:8181,access=http}'
;;
zdf|ZDF)
	PLAYLIST=http://wstreaming.zdf.de/encoder/livestream15_vh.asx
	#PLAYLIST=http://hstreaming.zdf.de/encoder/livestream15_vh.mov  #Alternative
	$VLC $PLAYLIST --sout '#standard{mux=ts,dst=:8181,access=http}'
;;
*)
	echo "USAGE: $0 ard oder $0 zdf"
;;
esac
