Skip to content
A util to extract raw video-URLs and format information from a YouTube-video page
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.npmignore
README.md
index-common.js
index.js
package.json

README.md

NOT MAINTAINED - SHOULD NOT BE USED IN PRODUCTION This is a html-parser, use with caution. Your app could be suspended from appstores.

npm npm

NativeScript YouTube Parser

A util to extract raw video-URLs and format information from a YouTube-video page. This way you can play YouTube videos in the native video player. The plugin is based on npm package youtube-parser and adapted to the NativeScript framework (removed cli & excess dependencies). Works on iOS and Android.

Installation

Run npm i nativescript-youtube-parser in the ROOT directory of your project.

Usage

getURL(url, format)

  • url - 'watch video' page on YouTube.
  • format - Object { quality: 'small | medium | high', container: 'mp4 | flv | 3pg | webm' }
  • return value - A promise object to resolve with an array of URL/format info objects that match the requested format.
var youtubeParser = require('nativescript-youtube-parser');

youtubeParser.getURL('https://youtu.be/C_vqnySNhQ0', { quality: 'medium', container: 'mp4' })
    .then(function (urlList) {
        console.log("YouTube mp4 video url: ", urlList[0].url);
    }
);

Changelog

1.1.0

  • Fixed an https issue on Android that would cause the plugin not to work

1.0.0

  • Initial release

Author

Original Author/Plugin

You can’t perform that action at this time.