Un tutorial y scripts para arrancar sopcast desde firefox.
Se parte de la base de que está instalado ya el sp-sc. Podéis hacerlo con este tutorial
En segundo lugar copiamos el script sopcast.sh en el directorio /usr/bin con el nombre sopcast.sh
sudo gedit /usr/bin/sopcast.sh
y copiamos el script siguiente:
#!/bin/sh
spsc=`ps -ef|grep "sp-sc sop:"|grep -v grep|awk {'print $2'}`
vlc=`ps -ef|grep vlc|grep -v grep|awk {'print $2'}`
if [ $spsc ]
then
kill -9 $spsc
fi
if [ $vlc ]
then
kill -9 $vlc
fi
sp-sc $1 8800 8900 1 > /dev/null &
sleep 9
vlc http://localhost:8900/tv.asf 1 > /dev/null &
;
Una vez terminado escribimos:
sudo chmod 777 /usr/bin/sopcast.sh
Para terminar creamos un script en el escritorio para parar el sopcast (esta vez sin sudo, simplemente creamos un nuevo archivo sh):
#!/bin/sh
spsc=`ps -ef|grep "sp-sc sop:"|grep -v grep|awk {'print $2'}`
vlc=`ps -ef|grep vlc|grep -v grep|awk {'print $2'}`
if [ $spsc ]
then
kill -9 $spsc
fi
if [ $vlc ]
then
kill -9 $vlc
fi
Para terminar habrá que añadir en firefox las siguientes entradas:
Abrir URL en firefox about:config
- Pulsamos botón derecho y añadimos nueva entrada -> lógica
Añadimos network.protocol-handler.external.sop con valor true.
- Pulsamos botón derecho y añadimos nueva entrada -> lógica
Añadimos network.protocol-handler.app.sop -> /usr/bin/sopcast.sh.
Y funcionando!!!
Si véis que no os funciona correctamente id ampliando el valor del sleep antes del arrancar el vlc, hasta que funcione.
