Skip to content

How it Works

kusti8 edited this page Mar 26, 2016 · 1 revision

RPi-youtube is divided into two sections, the extension and the native app.

The extension

The extension is totally separate from the native app. It lives in Chromium and its job is to detect youtube links or detect clicks on the icon. Once one of those is detected, it retrieves the url and sends what's called a native message to the native app. Because of security concerns, Chrome apps are not allowed to directly start or execute code on the machine. Instead, you must send a message to a program locally which will execute everything. The main part of the program is the native app.

The native app

The native app is called run_omxplayer.py and is a simple python script which reads the input through stdin and then runs omxplayerGUI with that url. run_omx.json is a manifest file which is installed in /etc/chromium-browser/native-messaging-hosts which tells Chromium where to find the program and all the necessary information. Once a message is sent to run_omxplayer.py, it reads that and runs omxplayerGUI.

Did you know RPi-youtube supports more than 600+ sites? https://rg3.github.io/youtube-dl/supportedsites.html

Clone this wiki locally