Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube in React: get channel id by current URL
export const getChannelId = (state, location, name) => {
const videoId = getSearchParam(location, name);
const video = state.videos.byId[videoId];
if (video) {
return video.snippet.channelId;
}
return null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.