On Linux and BSD platforms the options for video playback are:
1. the browser video player (HTML5)
2. video plugins (NPAPI): VLC, Gecko-mediaplayer, Totem (Gnome Videos), Mozplugger
3. external video player through a protocol
3.1 Create the viewtube script,
bash example using
mpv or
vlc for video playback
viewtube.sh
#! /bin/bash
s="$(echo "$1" | sed -e "s/viewtube://")"
v="$(echo "$s" | awk -F 'SEPARATOR' '{print $1}')"
a="$(echo "$s" | awk -F 'SEPARATOR' '{print $2}')"
if [ "$a" = "" ]; then
mpv --osc --fs --ytdl=yes "$v"
#cvlc -f "$v"
else
mpv --osc --fs --ytdl=yes --audio-file "$a" "$v"
#cvlc -f --input-slave "$a" "$v"
fi
3.2 Create the viewtube protocol file in ~/.local/share/applications
viewtube.desktop
[Desktop Entry]
Name=ViewTube Protocol
Exec=/path/to/viewtube.sh %u
Type=Application
Terminal=false
MimeType=x-scheme-handler/viewtube
Enable protocol:
xdg-mime default viewtube.desktop x-scheme-handler/viewtube
Test:
xdg-open viewtube:http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
3.3 Activate the protocol
Click here to associate the script to the protocol
3.4 Select 'VTP' in the second menu