/*! * video-service-url-parser - v0.1.6 - 2016-04-29 * https://github.com/thiagoh/video-service-url-parser * * Copyright (c) 2016 Thiago Andrade; * Licensed under the MIT license */ !function(a){"use strict";var b="youtube",c="dailymotion",d="vimeo",e=/(https?:\/\/)?(www\.)?youtube\.com\/watch.*/i,f=/(https?:\/\/)?(www\.)?youtu\.be\/(.+)(\?.*)?/i,g=/(https?:\/\/)?(www\.)?youtube\.com\/embed\/(.+)(\?.*)?/i,h=/(https?:\/\/)?(www\.)?dailymotion\.com\/video\/([^_]+)_?.*/i,i=/(https?:\/\/)?(www\.)?dai\.ly\/([^_]+)(\?.*)?/i,j=/(https?:\/\/)?(www\.)?dailymotion\.com\/embed\/video\/([^_]+)(\?.*)?/i,k=/(https?:\/\/)?(www\.)?vimeo.com\/channels\/.+\/(.+)(\?.*)?/i,l=/(https?:\/\/)?(www\.)?player\.vimeo\.com\/video\/(.+)(\?.*)?/i,m=/(https?:\/\/)?(www\.)?vimeo\.com\/(.+)(\?.*)?/i,n=function(a){var n,o,p,q;return e.test(a)===!0?(n=a.split("v=")[1],o=b):f.test(a)===!0?(p=f.exec(a),n=p[3],o=b):g.test(a)===!0?(p=g.exec(a),n=p[3],o=b):h.test(a)===!0?(p=h.exec(a),n=p[3],o=c):i.test(a)===!0?(p=i.exec(a),n=p[3],o=c):j.test(a)===!0?(p=j.exec(a),n=p[3],o=c):k.test(a)===!0?(p=k.exec(a),n=p[3],o=d):l.test(a)===!0?(p=l.exec(a),n=p[3],o=d):m.test(a)===!0&&(p=m.exec(a),n=p[3],o=d),"undefined"!=typeof n?(q=n.indexOf("?"),q=-1===q?n.indexOf("&"):q,n=-1!==q?n.substring(0,q):n,{service:o,videoId:n}):void 0};"undefined"!=typeof a?("undefined"!=typeof module&&module.exports&&(a=module.exports=n),a.parse=n):this.VideoServiceUrlParser=n}("object"==typeof exports&&exports||this);