Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_handleSearchSubmit = q => {
const query = q;
if (ytdl.validateURL(query)) {
const videoId = ytdl.getVideoID(query);
AppInstance.startInPlayer([{ videoId }]);
} else {
AppInstance.startSearch(query);
}
database.insertSearchHistory(new Date().getTime(), query).catch(e => console.error(e));
};
const AppInstance = props.AppInstance;