Embed Extender v1.7.4

Release Notes

  • Added a custom library, allowing to developers create customized embed code. It´s useful to embed local content providers and formats still not supported by the official plugin. In the custom library I put a code allowing the embedding of Yahoo Videos. The code works fine, but was developed for testing and learning purposes, so make some tests before allowing Yahoo videos in a production environment.
  • I hope this version will be the last 1.7 version. I am focused in migrate my plugins to 1.8. New releases should have bug corrections only.
  • If you make some custom embed code, share with us!
  • New version, guys. Now supporting a custom library. You can add your own embed code and, off course, share with the community.

    As always, send me some feedback about this version, and, if you like this plugin, recommend it! Recommending, you help new users to find the correct plugin and save hours of research.

  • Hi Ray are there any requirements for this plugins because I installed, enabled and set widths. The videos wont show in any of the sections. It olny shows in edit window then no where else. Please let me know what is needed or what I did wrong.Thank you

  • EmbedX's processing logic is really very simple -- a Simple hook into the views rendering and the media URL is transformed into the Live link for that media. Your problems are most likely caused by perhaps some other PlugIn interfering with that views mechanism. Try disabling all other 3rd party PlugIns..

  • Beautiful plugin Ray.

    Is there a way to make it support in the discussion within groups?

  • how to display video in the activity

  • $wire_dashboard = get_plugin_setting('dashboard_show', 'embed_extender');

    if($wire_dashboard == 'yes'){

    $object_dashboard = 'river/object/thewire/create';

    }

  • ha nevermind my large eyes looked too wide:P it was already there

  • @Seth: Yes, it works. :)

    @Mariano: No, its impossible to show videos in riverdashboard. River objects stores only a excerpt of the content, so my plugin can´t parse the url and show the video. It´s a behavior by design.

  • disculpa ray J pero ya lo pude lograr

    es facil

    Ray J thanks but I already solved

    is easy

    <?php

     

    function embed_extender_rewrite($hook, $entity_type, $returnvalue, $params){

    global $CONFIG;

     

    $view = $params['view'];

    $context = get_context();

    //activity/thewire

    //Check where embed code - The wire

    $wire_show = get_plugin_setting('wire_show', 'embed_extender');

    if($wire_show == 'yes'){

    $object_wire = 'object/thewire';

    }

    $wire_dashboard = get_plugin_setting('wire_dashboard', 'embed_extender');

    if($wire_dashboard == 'yes'){

    $object_dashboard = 'river/item/wrapper';

    }

    //Check where embed code - Blog posts

    $blog_show = get_plugin_setting('blog_show', 'embed_extender');

    if($blog_show == 'yes'){

    $object_blog = 'object/blog';

    }

     

    //Check where embed code - Comments

    $comment_show = get_plugin_setting('comment_show', 'embed_extender');

    if($comment_show == 'yes'){

    $object_comment = 'annotation/generic_comment';

    }

     

    //Check where embed code - Group topics

    $topicposts_show = get_plugin_setting('topicposts_show', 'embed_extender');

    if($topicposts_show == 'yes'){

    $object_topicposts = 'forum/topicposts';

    }

     

    //Check where embed code - Messageboard

    $messageboard_show = get_plugin_setting('messageboard_show', 'embed_extender');

    if($messageboard_show == 'yes'){

    $object_messageboard = 'messageboard/messageboard_content';

    }

     

    //Check where embed code - Pages

    $page_show = get_plugin_setting('page_show', 'embed_extender');

    if($page_show == 'yes'){

    $object_page = 'pages/pageprofile';

    }

     

    $supportedViews = array($object_page

    , $object_blog

    , $object_comment

    , $object_topicposts

    , $object_messageboard

    , $object_wire

    , $object_dashboard);

     

    //echo $view . ' Inicio ';

    //echo 'Contexto: ' . get_context();

     

    if (($view) && (in_array($view, $supportedViews))){

    $returnvalue = embed_extender_parser(' ' . $returnvalue . ' ', $view, $context);

     

    return $returnvalue;

    //return $returnvalue . $view . ' Fim ';

    }

        }

     

    function embed_extender_parser($input, $view, $context)

    {

    //Don't show vídeos in the The Wire widget due formatting issues.

    if ($context == 'profile' || $view == 'messageboard/messageboard_content'){

    $width = get_plugin_setting('widget_width', 'embed_extender');

    if (!isset($width) || !is_numeric($width) || $width < 0) {

    $width = 265; //Size for widgets and messageboard

    }

    }

    else{

    $width = get_plugin_setting('width', 'embed_extender');

    if (!isset($width) || !is_numeric($width) || $width < 0) {

    $width = 400; //Size for content

    }

    }

     

    $patterns = array('#(((http://)?)|(^./))(((www.)?)|(^./))youtube\.com/watch[?]v=([^\[\]()<.,\s\n\t\r]+)(?![^<]*</a>)#i'

    ,'/(http:\/\/)(www\.)?(vimeo\.com\/groups)(.*)(\/videos\/)([0-9]*)/'

    ,'/(http:\/\/)(www\.)?(metacafe\.com\/watch\/)([0-9a-zA-Z_-]*)(\/[0-9a-zA-Z_-]*)(\/)/'

    ,'/(http:\/\/)(www\.)?(vimeo.com\/)([0-9]*)/');

     

    $custom_provider = get_plugin_setting('custom_provider', 'embed_extender');

     

    if($custom_provider == 'yes'){

    $customPatterns = return_custom_patterns();

    }

     

    $supportedViews = array('object/blog'

    , 'annotation/generic_comment'

    , 'forum/topicposts'

    , 'messageboard/messageboard_content'

    , 'widgets/messageboard/view'

    , 'pages/pageprofile'

    , 'object/thewire'

    , 'river/item/wrapper');

     

    // Forget it. Doesn't work yet.

    /*

    if ($view == 'river/object/blog/create') {

    //if ($view == 'annotation/generic_comment') {

    //Ignore it. Doesn´t work yet

    $regexp = "/http:\/\/[a-z0-9A-Z.]+(?(?=[\/])(.*))/";

     

    foreach ($patterns as $pattern){

    if (preg_match_all($pattern, $input, $matches, PREG_SET_ORDER)){

    foreach($matches as $match){

    $input = str_replace($match[0], videoembed_create_embed_object($match[0], uniqid('embed_'), $width), $input);

    }

    }

    }

    }

    */

     

    if (($view) && (in_array($view, $supportedViews))){

     

    //Parses all links

    $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";

     

    //Replace video providers with embebed content

    if(preg_match_all("/$regexp/siU", $input, $matches, PREG_SET_ORDER)){

    foreach($matches as $match){

    foreach ($patterns as $pattern){

    if (preg_match($pattern, $match[2]) > 0){

    $input = str_replace($match[0], videoembed_create_embed_object($match[2], uniqid('embed_'), $width), $input);

    }

    }

     

    if($custom_provider == 'yes'){

    foreach ($customPatterns as $pattern){

    if (strpos($match[2], 'yahoo.com') != false){

    echo('bbaabb'.preg_match($pattern, $match[2]));

    }

    if (preg_match($pattern, $match[2]) > 0){

    $input = str_replace($match[0], custom_videoembed_create_embed_object($match[2], uniqid('embed_'), $width), $input);

    }

    }

    }

    }

    }

    }

     

    return $input;

    }

    ?>

  • @Mariano: Your solution doesn´t work. Make a simple test: Type about 195 words in a blog post and, after the words, paste a youtube url. In the river, you will see ther 195 words and half of the URL. In this case, the embeding doesnt works. That is the reason because I embed videos only in full contents. The river is a excerpt, a fraction of the content. Give a look. :)

  • y vas a ver que si funciona

  • @Mariano: Yo soy Brasileño, pero nosotros podemos hablar en portugues e espanhol, ok? Su solução no funciona, pois el objecto "river" muestra solamente una pequena fracion del contenido. Se tu inputar 195 letras I colar una URL de youtube, el objecto "river" mostrará las 195 letras e solamente metade de la URL. Faça o teste.

  • @Mariano: Yo registralo in su pagina i feito los testes. No funciona, como yo tengo hablado. Su solucion fue testada por nosotros semanas atras. Es impossible.

    @Mariano: I´d registered in your site and make the test with 195 words. Doesnt work in the river, like I advertised. Your solution was tested by about a month ago. It´s impossible,

  • mira pues si compartes un video en el cuadro de estados en mi pagina pues el video si se ve 

  • @Mariano: Ok, I will not discuss it with you. The plugin doesn't works well with river, I registered in your site and show the evidences. Embeding videos in river works ONLY if the url is in the beginning of the text. For me, doesn't work.

    @Mariano: Yo no puedo discutir com vosotros. Por supuesto el plugin no funciona in objecto "river". Yo registra-lo in su site i mostrado el problema. Exibir videos en objecto "river" funciona solamente se la URL estas em el inicio de la message. Para nosostros, no es suficiente.

  • Great Mariano. I tested in floops and for me work. @ray, is right that if you write more than "x" letters the video doesn't works well, and if you put first the url, and then the text, don't show the text. but for me is a gran solution to show my url, normally the people that share a url in your status, only put the url. Thanks Ray, Thanks Mariano.

     

    * Gracias Mariano, como siempre estás echo un GRANDE. Tiene razón Ray en que si pones un texto muy grande antes de la url , esta solo aparece cortada, o si pones la url primero y luego el texto, el texto no aparece, pero para mi me parece una opción buenisima para compartir mi estado en el muro en forma de url. jejejej.

  • Hi Ray,

    I had to deactivate the plugin.  It took me a few weeks to figure out that it was causing the activity page to slow down, a lot.

  • Using embeded extended 1.7.4 with elgg 1.7.11. Appears to work well, but I am getting reports from users that they see a text directly above all videos. I've tested and find that this indeed does happen, but not all the time. Some of my computers with various browsers has the problem some do not. This is what people are seeing ...

    #embedvideoembed_4e930780a430b { height: 325px; width: 400px; }

    right below this is the video

    Anyone have any idea how to fix this? Thanks.

  • Me back again, about the above mentioned problem. Is anyone else having this problem? Anyone have any idea how to fix it?

    The problem is ...

    In some browsers, not all, specifically for me right now Firefox 7.1 on a Mac (although other users have complained also)... Every Video has a text appear right above it, as follows...

    #embedvideoembed_4e930780a430b { height: 325px; width: 400px; }

    right below this text is the video (it works fine)

    Thank  you if you can shed any light on this.

  • I checked out several other browsers and Macs and PCs. They each are displaying the text above the video as I describe above. I'm simply pasting the URL in the various documents where I want the video to display. Is this wrong?

    I think this is such a useful plugin that everyone should be using it, and I would think that if many people are using it, that at least one other person has found this problem. So, is there someone else using it? If so, I'd like to look at your site and see if it works ok, without the text.

    But, maybe no one else is having the problem - if so, please say so. I guess I'll have to start deactivating plugins and see if there is a conflict. I'll report back my finding.

  • @Ron: I will check what´s happening. Do you use any theme? Can you please list your plugins here?

  • This is the strangest thing. It appears it has something to do with whose doing the publishing as well as whose looking at the video. I logged in using my regular user id,  pasted a URL from one of my client's locations last evening, came back to the office and tested it, NO text. There I was using a Windows PC with an old version of Explorer.

    Yet, I pasted the same URL here, using the same login, but using my Mac and Firefox - and the text DOES appear.

    One other thing. I paste the same URL in from my office, using another Mac with an older version of Firefox, the Text DOES NOT appear. But, whenI look at the same video using another Mac with a more current version of Firefox, it DOES appear.

    @Ray: I am using the HypeStyler themes, but I have deactivated it and the same thing happens. I don't believe the theme has anything to do with it. I'm using several plugins that I will test this morning and see if they have anything to do it.  I'll report back. It's very easy for me to verify. All I have to do is paste a YouTube URL and presto the text appears after I post. That is, as long as I paste it and view it from this and similar version browsers.

    Back to you soon and let you know what I learn. Thanks.

  • @Ray: I found it. I've narrowed it down to iZap Video. When I deactivate iZap Video all text disappears. I'm using the most current version of iZap Video for elgg 1.7, which is 3.9.

    I've tried moving Embed Extender above and below iZap Video. It makes no difference. If it's on, no matter where it is, the text appears.

    So, in summary, there is some kind of conflict with this plugin and IZap Video that causes the above mentioned text to appear above a video with some browsers, not all.

    Make sense?

    PS. In my opinion, this is one of the most valuable plugins we have. Can't believe it or something similar is not a standard elgg plugin. Video is here to stay folks. This plugin brings elgg into the 21 century. What I'd like, also, is the ability to do the same thing with audio.

    @Ray: If I can help further, let me know. I look forward to a fix. Your help is most appreciated. Thank you.

Matt Beckett

I'm a self-employed web developer, family man, nerd, scuba diver. Manager/maintainer of this elgg community site, and core Elgg development team member.

Project Info

Stats

  • Category: Media
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 12283
  • Recommendations: 70

Other Projects

View Matt Beckett's plugins

Contributors