/* MediaElement ================================================== */ if(typeof VMM != 'undefined' && typeof VMM.MediaElement == 'undefined') { VMM.MediaElement = ({ init: function() { return this; }, loadingmessage: function(m) { return "
" + "

" + m + "

"; }, thumbnail: function(data, w, h, uid) { var _w = 16, _h = 24, _uid = ""; if (w != null && w != "") {_w = w}; if (h != null && h != "") {_h = h}; if (uid != null && uid != "") {_uid = uid}; if (data.thumbnail != null && data.thumbnail != "") { trace("CUSTOM THUMB"); mediaElem = "
"; return mediaElem; } else if (data.media != null && data.media != "") { var _valid = true, mediaElem = "", m = VMM.MediaType(data.media); //returns an object with .type and .id // DETERMINE THUMBNAIL OR ICON if (m.type == "image") { mediaElem = "
"; return mediaElem; } else if (m.type == "flickr") { mediaElem = "
"; return mediaElem; } else if (m.type == "instagram") { mediaElem = "
"; return mediaElem; } else if (m.type == "youtube") { mediaElem = "
"; return mediaElem; } else if (m.type == "googledoc") { mediaElem = "
"; return mediaElem; } else if (m.type == "vimeo") { mediaElem = "
"; return mediaElem; } else if (m.type == "vine") { mediaElem = "
"; return mediaElem; } else if (m.type == "dailymotion") { mediaElem = "
"; return mediaElem; } else if (m.type == "twitter"){ mediaElem = "
"; return mediaElem; } else if (m.type == "twitter-ready") { mediaElem = "
"; return mediaElem; } else if (m.type == "soundcloud") { mediaElem = "
"; return mediaElem; } else if (m.type == "google-map") { mediaElem = "
"; return mediaElem; } else if (m.type == "googleplus") { mediaElem = "
"; return mediaElem; } else if (m.type == "wikipedia") { mediaElem = "
"; return mediaElem; } else if (m.type == "storify") { mediaElem = "
"; return mediaElem; } else if (m.type == "quote") { mediaElem = "
"; return mediaElem; } else if (m.type == "iframe") { mediaElem = "
"; return mediaElem; } else if (m.type == "unknown") { if (m.id.match("blockquote")) { mediaElem = "
"; } else { mediaElem = "
"; } return mediaElem; } else if (m.type == "website") { mediaElem = "
"; return mediaElem; } else { mediaElem = "
"; return mediaElem; } } }, create: function(data, uid) { var _valid = false, //loading_messege = "

" + VMM.master_config.language.messages.loading + "

"; loading_messege = VMM.MediaElement.loadingmessage(VMM.master_config.language.messages.loading + "..."); if (data.media != null && data.media != "") { var mediaElem = "", captionElem = "", creditElem = "", _id = "", isTextMedia = false, m; m = VMM.MediaType(data.media); //returns an object with .type and .id m.uid = uid; _valid = true; // CREDIT if (data.credit != null && data.credit != "") { creditElem = "
" + VMM.Util.linkify_with_twitter(data.credit, "_blank") + "
"; } // CAPTION if (data.caption != null && data.caption != "") { captionElem = "
" + VMM.Util.linkify_with_twitter(data.caption, "_blank") + "
"; } // IMAGE if (m.type == "image") { mediaElem = "
"; // FLICKR } else if (m.type == "flickr") { //mediaElem = "
" + loading_messege + "
"; mediaElem = "
"; VMM.ExternalAPI.flickr.get(m); // INSTAGRAM } else if (m.type == "instagram") { mediaElem = "
"; // GOOGLE DOCS } else if (m.type == "googledoc") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.googledocs.get(m); // YOUTUBE } else if (m.type == "youtube") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.youtube.get(m); // VIMEO } else if (m.type == "vimeo") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.vimeo.get(m); // DAILYMOTION } else if (m.type == "dailymotion") { mediaElem = "
"; // VINE } else if (m.type == "vine") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.vine.get(m); // TWITTER } else if (m.type == "twitter"){ mediaElem = "
" + loading_messege + "
"; isTextMedia = true; VMM.ExternalAPI.twitter.get(m); // TWITTER } else if (m.type == "twitter-ready") { isTextMedia = true; mediaElem = m.id; // SOUNDCLOUD } else if (m.type == "soundcloud") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.soundcloud.get(m); // GOOGLE MAPS } else if (m.type == "google-map") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.googlemaps.get(m); // GOOGLE PLUS } else if (m.type == "googleplus") { _id = "googleplus_" + m.id; mediaElem = "
" + loading_messege + "
"; isTextMedia = true; VMM.ExternalAPI.googleplus.get(m); // WIKIPEDIA } else if (m.type == "wikipedia") { mediaElem = "
" + loading_messege + "
"; isTextMedia = true; VMM.ExternalAPI.wikipedia.get(m); // STORIFY } else if (m.type == "storify") { isTextMedia = true; mediaElem = "
" + m.id + "
"; // IFRAME } else if (m.type == "iframe") { isTextMedia = true; mediaElem = "
"; // QUOTE } else if (m.type == "quote") { isTextMedia = true; mediaElem = "
" + m.id + "
"; // UNKNOWN } else if (m.type == "unknown") { trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML"); isTextMedia = true; mediaElem = "
" + VMM.Util.properQuotes(m.id) + "
"; // WEBSITE } else if (m.type == "website") { mediaElem = "
" + loading_messege + "
"; VMM.ExternalAPI.webthumb.get(m); //mediaElem = "
" + "
"; // NO MATCH } else { trace("NO KNOWN MEDIA TYPE FOUND"); trace(m.type); } // WRAP THE MEDIA ELEMENT mediaElem = "
" + mediaElem + creditElem + captionElem + "
"; // RETURN if (isTextMedia) { return "
" + mediaElem + "
"; } else { return "
" + mediaElem + "
"; } }; } }).init(); }