Browse Source

make iframe media type parser accept double or single quotes

pull/553/head
Joe Germuska 11 years ago
parent
commit
86be52486b
  1. 10
      source/js/Core/Media/VMM.MediaType.js

10
source/js/Core/Media/VMM.MediaType.js

@ -124,9 +124,13 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
} else if (d.match('iframe')) { } else if (d.match('iframe')) {
media.type = "iframe"; media.type = "iframe";
trace("IFRAME") trace("IFRAME")
trace( d.match(/src\=([^\s]*)\s/)[1].split(/"/)[1]); regex = /src=['"](\S+?)['"]\s/;
media.id = d.match(/src\=([^\s]*)\s/)[1].split(/"/)[1]; group = d.match(regex);
success = true; if (group) {
media.id = group[1];
}
trace( "iframe url: " + media.id );
success = Boolean(media.id);
} else { } else {
trace("unknown media"); trace("unknown media");
media.type = "unknown"; media.type = "unknown";

Loading…
Cancel
Save