How to use react-native-ytdl - 5 common examples

To help you get started, we’ve selected a few react-native-ytdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AbelTesfaye / dingo / src / UI / Pages / PageSearch.js View on Github external
_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;
github AbelTesfaye / dingo / src / BL / Services / event-handler-service.js View on Github external
[shouldFetchCurrent ? trackCurrent : {}, ...tracksToRight, ...tracksToLeft].map((item, index) => {
						if (item.videoId && ytdl.validateID(item.videoId)) {
							this._ytdlGetInfo(
								item.videoId,
								info => {
									console.log(JSON.stringify(info));
									const highestQualityAudio = this._filterHighestQualityAudio(info.formats);

									this._updateTrackPlayerQueueItem(
										tracks,
										item,
										{
											url: highestQualityAudio,

											title: info.title,
											artist: info.author.name,
											artwork: info.thumbnail_url,
										},
github AbelTesfaye / dingo / src / UI / Pages / PageSearch.js View on Github external
_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;
github AbelTesfaye / dingo / src / BL / Services / event-handler-service.js View on Github external
_filterHighestQualityAudio = formats => {
		let audioFormats = ytdl.filterFormats(formats, 'audioonly');

		let highestFormat = audioFormats[0];
		audioFormats.map(item => {
			if (highestFormat.audioBitrate < item.audioBitrate) highestFormat = item;
		});
		const highestQualityAudio = highestFormat.url;

		return highestQualityAudio;
	};
	_ytdlGetInfo = (videoId, callback, errCallback) => {
github AbelTesfaye / dingo / src / BL / Services / event-handler-service.js View on Github external
_ytdlGetInfo = (videoId, callback, errCallback) => {
		ytdl.getInfo(videoId, {}, (err, info) => {
			if (err) errCallback(err);
			callback(info);
		});
	};
	_getHighestQualityAudioUsingYtdl = (videoId, callback, errCallback) => {

react-native-ytdl

YouTube video and audio stream extractor for react native.

ISC
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis