mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 05:13:04 +03:00
temporary update to youtube id regex
This commit is contained in:
parent
68a883cf78
commit
645c795453
@ -1,9 +1,9 @@
|
||||
|
||||
|
||||
export default (url) => {
|
||||
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/;
|
||||
var regExp = /(?:youtube.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu.be\/)([^"&?/\s]{11})/;
|
||||
var match = url.match(regExp);
|
||||
var videoId = (match&&match[7].length==11)? match[7] : false;
|
||||
var videoId = (match&&match[1].length==11)? match[1] : false;
|
||||
|
||||
console.log("Extracting id ", videoId, url);
|
||||
return videoId;
|
||||
|
Loading…
Reference in New Issue
Block a user