Getting Started
Introduction
Welcome to the YouTube Player documentation. You may find a lot of answers for your questions here.
Still problems? Feel free to contact me on discord (Yazaar#1779) or twitch.
Videos
Video Search
Find the big search box and treat it like an official YouTube search box. Click search and wait for videos to
appear.
Not working? Try to swap API key.
View Playlist
Find your YouTube playlist URL which is public. Paste it into the big search box and click the "Search
Playlist" button.
Not working? Try to swap API key.
example URL: https://www.youtube.com/playlist?list=PLYH8WvNV1YEnblnazwa6y27kkeqg35dfz
Add By URL
Find your YouTube video URL which is public. Paste it into the big search box and click the "Find Video"
button.
Works without API key!
example URL: https://www.youtube.com/watch?v=-g7yAXPuu6A
Google API
Information
The search box is powered by the google API which means that a key is required. Each key has a limited amount
of "points" which you as an user may use each day. This leads to problems if a large amount of people are
using the website. The official key runs out of "points" or "quotas" as it is called. Use your private key
to decrease your limitations.
Songrequests and searching for a specific video through a URL works without
the API key! But it will try to use the key for an extended amount of data.
Swap Key
-
YouTube video guide (not by me)
- Open up the google console and login to your google account.
- Click "Select a project" which can be found top left.
- A window should pop up with the button "NEW PROJECT" located top right, click it.
- Feel free to swap the project name but this is not required. Skip location and click the blue "CREATE" button.
- Make sure that the notifications pops up, or click on the bell located top right. Wait for your project to be created. You might have to reopen the notifications to notice that it is finished!
- When finished, click on the created project. Wait for the page to load and open up the navigation menu (found top left).
- Hover over "APIs & Services" and click on "Dashboard".
- Find the blue text "+ ENABLE APIS AND SERVICES" and click it.
- In the white searchbox "Search for APIs & Services" search for YouTube.
- Click on the box "YouTube Data API v3"
- Click on the blue box "ENABLE".
- Open up the navigation menu, hover over "APIs & Services" and click on "Cridentials".
- Click the blue button "create cridentials" and then on "API key"
- Copy your key which should pop up and click close (feel free to restrict your key but this is not required).
- Save the API key somewhere, nobody can use your key to gain personal information but keep it safe from others to save your quotas/points.
Songrequest
Usage
Are you a broadcaster on twitch? If so, feel free to connect the YouTube player to your twitch chat to enable
video-requests! Everyone in your chat are able to request a limited amount of videos which is
configurable. The caster and moderators are able to request any amount of videos.
Warning, users are
able to request anything from the YouTube platform!
Setup
- Open up the YouTube player.
- Click on the button "Toggle songrequest"
- Click "Get TMI" and connect with Twitch.
Keep the TMI secret and generate a new one through "Get TMI" if exposed, people may use the TMI and type in your twitch chat through YOUR ACCOUNT which gives them broadcaster rights! - Copy the oauth and paste it into the TMI passwordbox on the player.
- Type in your twitch user account in textbox 2.
- Type in the channel that you would like to listen on, usually your own twitch username.
- Click on the "CONNECT" button. Should be in your channel to listen on the command found underneath
- Feel free to change the command by typing in the command textbox
- Feel free to change the request limit per user through the numberfield. Mods and casters are not included.
Commands
- !yt request VideoURL/VideoId >> Request video (everyone, always)
- !yt wrong >> Remove your latest request (everyone)
- !yt current >> Get the video which is currently playing (everyone)
- !yt queue >> get the video queue (everyone)
- !yt guide/docs/help/documentation >> get the docs URL (everyone, always)
- !yt commands >> get the docs URL, to the command section (everyone, always)
- !yt volume >> Get the YouTube volume (everyone)
- !yt volume 0-100 >> Change the YouTube volume (moderator)
- !yt skip >> Skip the video that is currently playing (moderator)
- !yt pause >> Pause the YouTube video (moderator)
- !yt play >> Play the paused or ended YouTube video (moderator)
Not all commands works before you start the YouTube player, commands with "always" always work.
Socket
Usage
Would you like to forward what is currently playing to a third part source? If so connect, it through a websocket (socketIO) connection. This can be used to create overlays and much more. The website is automatically going to forward over what is currently playing and some other useful details.
This was built for my own software called LocalStreamElements to enable a stream overlay, feel free to use it to host a local websocket with ease.
Setup
- Open up the YouTube player.
- Click the button "Toggle socket".
- 2 input fields should appear:
The first one should be the target. If your websocket connection is hosted on the current machine you can leave it as localhost. Else, insert the local ip address to your machine which is hosting the socket. (windows users: open up cmd which is a program on all machines, type ipconfig and check for your IPv4 Address)
The second one should be a number which represents the port that the websocket is running on. The standard is port 80 but it differs on configuration.
http://192.168.1.50:5000 (192.168.1.50 = host and 5000 = port) - Your socketIO server should listen to the event ScriptTalk and it takes 1 argument which contains all of the data. If you are using my software LocalStreamElements, listen on the event called p-Yazaar_YouTube_Analyzer:Changes
- code examples!
Overlay
Usage
Are you a streamer? If so, feel free to use the overlay functionality to show your viewers what is currently playing.
Setup
- Open up the YouTube player.
- Click the button "Toggle overlay".
- The overlay should pop up and you unlock the possibility to change the overlay settings as well as using a few settings presets. I would personally recommend number 1.