For youtube videos I use a very simple bash script that plays locally in
mplayer using youtube-dl:
###########
#!/bin/bash
ytdlbin="/usr/bin/youtube-dl"
ytdlopts="-g "
mplayer `$ytdlbin $ytdlopts "$*"` &> /dev/null
###########
All you have to do is ' ./script.sh
"http://www.youtube.com/watch?v=videocode" '. Browser addons would bug on me
and not load the video sometimes. Youtube-dl only works with youtube though.
For other websites you could check cclive and modify the script but have not
tried it myself since I only use youtube.