Watch YouTube-Videos in surf-browser on PocketC.H.I.P


#1

This thread is for any of you who are searching for a way to play YT-Videos in their browser on PocketC.H.I.P.
At first you need to get youtube-dl: https://rg3.github.io/youtube-dl/
Exchange the preinstalled surf-browser with the one from suckless.org:

  • sudo apt remove surf
  • wget http://dl.suckless.org/surf/surf-0.7.tar.gz
  • gunzip surf-0.7.tar.gz
  • tar -xvf surf-0.7.tar
  • cd surf-0.7/

read through the README and install all dependencies (including libwebkitgtk-dev)

  • sudo make clean install

edit config.h to fit your needs (see my config.h at https://gajaspace.de/s/2hssQuyTEPVftsR), I edited the default flags for scripts and plugins to disable javascript and plugins by default
add the WATCH-function from my example config.h
add a key binding to start WATCH to your config.h (see example config.h, I chose to use ctrl+w)
download ytvid.sh (see attachment) to /home/chip/scripts/

ytvid.sh (55 Bytes)

  • cd /home/chip/scripts
  • sudo chmod +x ytvid.sh

change to your surf directory

  • sudo make clean install

install st from suckless.org

now you can watch YouTube-Videos in your surf-browser
start surf:

  • surf

press ctrl+g and go to YouTube
search for any video, when you reach the video page, press ctrl+w (or whatever keybinding you chose) and the video should play in about a few seconds.

ytvid.sh:
#!/bin/bash
youtube-dl -q -f 36 -o- $1 | mplayer -fs -

ytvid starts youtube-dl and tells it to be quiet (-q), use videoformat 3gp,320x180, to fit on PocketCHIP’s screen (-f 36), output to stdout (-o-). $1 is the URL from surf, the output is then piped to mplayer, which is started in fullscreen (-fs) and the final dash tells mplayer to read from stdin

see youtube-dl --help and man mplayer for further details
and have fun, watching YouTube-Videos :wink:


Best way to play YT videos on Pocket CHIP
Media player tweaks
New PocketCHIP user, reactions/wishlist from a GUI Designer and Linux Noob
#2

Im still waiting for my pocketchip to ship. If it’s not any trouble could you (or anyone else) post video or at least few screenshots


#3

Here you go, here’s PocketCHIP playing TWiT’s interview with Dave about PocketCHIP:


#4

because you can not upload videos to this Website, I posted a video of me, playing a YT-video on PocketC.H.I.P. here:
https://gajaspace.de/s/ZOmnfSvPCF8muWm

and here’s an image of my PocketC.H.I.P. running the current version of PocketHOME Marshmallow Edition:



#5

I feel I need to record a video of me using the pocketchip upload it to youtube then make a video of me playing the youtube video of me using the pocket chip.


#6

Your post reminds me of the massive headache I got trying to watch INCEPTION! It was was worse than the one I got trying to figure out the ending to the third Matrix movie!
But in all seriousness, I do like it when people can show off the the neat stuff they are doing, so keep the videos coming!
I guesstimate my Pocket C.H.I.P. ought to be here in a couple week, so I cannot wait to try this!


#7

I go home with a day or two! im so excited to use my pocketchip


#8

Mine is still in customs… One week down, and one more to go… I hope!


#9

Thanks. It worked perfecly.


#10

Which GTK and webkit are you using? Tried installing and still getting make errors, No package ‘webkit-1.0’ and No package ‘gtk±2.0’


#11

it seems like you need to install the development-package:

  • sudo apt install libwebkitgtk-dev

#12

Have been on vacation without my PocketChip. When I get settled I will try this. Thanks for the heads up.


#13

I modified your submission to not require ‘st’ of suckless to work , but just use vala-terminal as is included already.

As soon as i remember where tf i left my pocketchip, i’ll package and share :wink:

The only issue it has is that vala-terminal doesn’t close automagically when the -e script is done. Tiny ctrl-D action required :stuck_out_tongue:


#14

Is there any way to stretch the size of the video to cover the whole screen?


#15

as I use a customized version of st instead of the vala terminal for easier copy and paste (without the touchscreen), I’ll stay with my version


#16

Cool, did you post it somewhere?


#17

You can make the mplayer script stretch the video to fullscreen;.
The command line in my script now is ;

youtube-dl -f 36 -o- $1 | DISPLAY=:0 mplayer -vf scale -zoom -xy 480 -fs -


#18

not yet, I’m on holidays right now, I’ll post it, when I’m back home, in october


#19

So here’s a link to my st.tar. I’m not quite sure if I just needed to customize config.h or also the c sources. If you’re curious, you can have a look for yourself :wink: It supports scrolling up and down with shift+up or shift+down (I applied a patch from suckless.org) and copy and paste with ctrl+shift+c and ctrl+shift+v (this can be achieved just by customizing config.h).
https://gajaspace.de/s/AHIOyoaMfxv1P1n


#20

sweet :smiley: i’ll try it it in a bit