How to use the js-video-url-parser.create function in js-video-url-parser

To help you get started, we’ve selected a few js-video-url-parser examples, based on popular ways it is used in public projects.

github hennessyevan / netlify-cms-widget-youtube / src / Control.js View on Github external
writeOut = e => {
		if (this.props.field.get("extraInfo")) {
			try {
				const { id, provider, mediaType } = urlParser.parse(e.target.value);
				const videoInfo = urlParser.parse(e.target.value);
				this.props.onChange({
					url: e.target.value,
					id: id,
					mediaType: mediaType,
					imageURL: urlParser.create({
						videoInfo,
						format: "longImage",
						params: { imageQuality: "maxresdefault" }
					})
				});
			} catch (err) {
				console.error("Not a valid Youtube URL");
				this.props.onChange(e.target.value);
			}
		} else {
			this.props.onChange(e.target.value);
		}
	};
github orange-alliance / the-orange-alliance / src / app / dialogs / match / dialog-match.ts View on Github external
searchVideo() {
    if (this.match && this.match.videoURL) {
      const video = urlParser.parse(this.match.videoURL);
      let embedURL = urlParser.create({
        videoInfo: video,
        params: 'internal',
        format: 'embed'
      });

      if (embedURL) {
        if (embedURL.startsWith('//')) {
          embedURL = 'https:' + embedURL;
        }
        this.videoSafeURL = this.sanitizer.bypassSecurityTrustResourceUrl(embedURL);
      }
    }
  }
}
github hennessyevan / netlify-cms-widget-youtube / src / Preview.js View on Github external
getImage(videoInfo) {
		if (videoInfo) {
			return urlParser.create({
				videoInfo,
				format: "longImage",
				params: { imageQuality: "maxresdefault" }
			});
		}
	}

js-video-url-parser

A parser to extract provider, video id, starttime and others from YouTube, Vimeo, ... urls

MIT
Latest version published 10 months ago

Package Health Score

66 / 100
Full package analysis

Popular js-video-url-parser functions

Similar packages