Hey guys, first of all: I am trying my best with coding but stuff won’t work.
I am working on a streaming website, kinda creating a small streaming community.
I got so far to embed the livestreams/streams to the website and now I am stuck with the VOD:
I kinda looked into the live code of the twitch site and I guess that there is no way around using the API to get the last X VOD. In my mind i would like to have the last 3 VOD in a row and some sort of description.
Simple example:
Description | VOD1 | VOD2 | VOD3
Now the million dollar question:
Can I grab the latest vod’s WITHOUT using the API and get a code into my html/css/js?
For example: I used following code to show the preview you get when you are looking for a streamer; it shows in intervalls (dont know exactly which ones) the video that is been streamed (does not work on offline streams) but it is a fun little gimmick:
So basically there is no work around around the api?
Checking the Sourcecode of the VOD section of my stream it gives the video an ID, and I guess that that ID is being called from the database through the API, am I right with that?
(I am seriously a noob and I feel uncomfortable)
Without calling the API where do you get the video ID’s from?
Basically yeah, the API will lookup videos on Twitch’s database filtering by the search parameters you feed in (broadcasterID, video type etc) and return them
Well your front end needs to get fetch the video ID’s from the backend and just invoke after loading those ID’s. Whether you do that via server side rendering or post load fetch request via an API style endpoint you provide is up to you
nothing shows up basically. I know the workaround with the OAuth token is not the most elegant but just literally nothing shows up on the website.
Edit:
I went to dev.twitch and created a new app, gave it a name etc and copied the Client ID and the Secret (I assume the Bearer Token) into the script
What you have linked to doesn’t cover token generation, and describes using tokens in the front end, (which generally speaking you shouldn’t use unless it’s the website users own token)
This is the documentation for server side token generation
Provides three different language examples on generating a server side token.