Elxis CMS Forum

Support => General => Topic started by: rentasite on April 18, 2010, 14:04:17

Title: Videos on Elxis eBlog / Elxis content [SOLVED]
Post by: rentasite on April 18, 2010, 14:04:17
Hi,

what i realized is that, Youtube/Google videos published on Elxis Content show perfect on mobile devices (iphone, ipod exc), but the same videos published on Elxis eBlog do not show at all.

Can someone plz confirm?
Title: Re: Videos on Elxis eBlog / Elxis content
Post by: CREATIVE Options on April 18, 2010, 14:25:42
Check how the videos inserted, html code of the video is the same ?
Title: Re: Videos on Elxis eBlog / Elxis content
Post by: rentasite on April 18, 2010, 18:25:49

I made a comparison. Tried a replacement, but did not work.

This is the youtube bot - Replacer code

function elxYouTube_replacer ( &$matches ) {
    $videoid = $matches[1];   

    $out = "<object width=\"425\" height=\"350\">\n";
    $out .= "<param name=\"movie\" value=\"http://www.youtube.com/v/".$videoid."\"></param>\n";
    $out .= "<param name=\"wmode\" value=\"transparent\"></param>\n";
    $out .= "<embed src=\"http://www.youtube.com/v/".$videoid."\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed>\n";
    $out .= "</object>\n";
    return $out;

And this is the Replacer code - for eBlog

static private function youTube_replacer(&$matches ) {
       $videoid = $matches[1];

      $out = '<div>'._LEND;
       $out .= '<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/'.$videoid.'&hl=en&fs=1&rel=0">'._LEND;
      $out .= '<param name="movie" value="http://www.youtube.com/v/'.$videoid.'&hl=en&fs=1&rel=0" />'._LEND;
      $out .= '<param name="wmode" value="transparent"></param>'._LEND;
      $out .= '<param name="allowFullScreen" value="true" />'._LEND;
      $out .= '</object>'._LEND;
      $out .= '</div>'._LEND;
       return $out;

 ::) :-\
Title: Re: Videos on Elxis eBlog / Elxis content
Post by: CREATIVE Options on April 18, 2010, 19:32:06
make an other try by removing the 2     
Code: [Select]
$out = '<div>'._LEND;
Title: Re: Videos on Elxis eBlog / Elxis content
Post by: rentasite on April 18, 2010, 20:08:17

I tried it right now, Niko. No it does not solve the problem.

and it also spoils the right column of the site.
Title: Re: Videos on Elxis eBlog / Elxis content
Post by: CREATIVE Options on April 18, 2010, 20:29:19
One last try from me:
Code: [Select]
static private function youTube_replacer(&$matches ) {
       $videoid = $matches[1];

      $out = '<div>'._LEND;
      $out .= '<object style="width:425px; height:350px;" data="http://www.youtube.com/v/'.$videoid.'&hl=en&fs=1&rel=0">'._LEND;
      $out .= '<param name="movie" value="http://www.youtube.com/v/'.$videoid.'&hl=en&fs=1&rel=0" />'._LEND;
      $out .= '<param name="wmode" value="transparent"></param>'._LEND;
      $out .= '<embed src=\"http://www.youtube.com/v/".$videoid."\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed>._LEND;
      $out .= '</object>'._LEND;
      $out .= '</div>'._LEND;
       return $out;
Title: Re: Videos on Elxis eBlog / Elxis content
Post by: rentasite on April 18, 2010, 20:37:25

Nope. Blank page.

i have tried from yesterday lot's of combinations, but no.... does not work.
Title: Re: Videos on Elxis eBlog / Elxis content
Post by: webgift on April 18, 2010, 23:36:41
YouTube APIs + iPhone = Cool mobile apps
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html


How To Play YouTube Videos Within an Application
http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application


We must insert an if  -  else on the youTube_replacer function.
Title: Re: Videos on Elxis eBlog / Elxis content
Post by: rentasite on April 19, 2010, 09:47:04
Thanks to WebGift, the function is working 99% perfect!  :D

I must say, that everything started from this reference:  http://learningtheworld.eu/2009/youtube-embed/

Notice: The only disfunction is that... when watching the video and clicking "DONE" on the player... it does not return you back to the previous web page, but personally i do not care.

eBlog now can show smoothly ...Youtube videos on iPhone, iPad and iPod touch. Thanks Stavro  ;) ;)



     /********************/
    /* YOUTUBE REPLACER */
    /********************/
    static private function youTube_replacer(&$matches ) {
        $videoid = $matches[1];

        $out = '<div>'._LEND;
        $out .= '<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/'.$videoid.'" width="480" height="360" />'._LEND;
        $out .= '<param name="movie" value="http://www.youtube.com/v/'.$videoid.'" />'._LEND;
        $out .= '<param name="quality" value="high" />'._LEND;
        $out .= '<param name="allowFullScreen" value="true" />'._LEND;
        $out .= '<a href="http://www.youtube.com/watch?v='.$videoid.'" />'._LEND;
        $out .= '<img src="http://img.youtube.com/vi/'.$videoid.'/0.jpg" width="480" height="360" /></a>'._LEND;
        $out .= '</object>'._LEND;
        $out .= '</div>'._LEND;
        return $out;
    }
Title: Re: Videos on Elxis eBlog / Elxis content [SOLVED]
Post by: webgift on April 19, 2010, 09:49:03
Nothing Spiro!!! my pleasure.!!! ...
It will to it to work 100%. ;)
Don't tell you 101%  ;D ;D

we must edit  to close the <a .... the

 $out .= '<img src="http://img.youtube.com/vi/'.$videoid.'/0.jpg" width="480" height="360" />'._LEND;

with

 $out .= '<img src="http://img.youtube.com/vi/'.$videoid.'/0.jpg" width="480" height="360" />..</a>'._LEND;
Title: Re: Videos on Elxis eBlog / Elxis content [SOLVED]
Post by: CREATIVE Options on April 19, 2010, 10:15:27
@ElxisTeam

Can this be part of the 2009.2 & 2011 ?
Title: Re: Videos on Elxis eBlog / Elxis content [SOLVED]
Post by: rentasite on April 19, 2010, 10:18:08

Done Stavro. But no, that's not the problem.

updated the above code, also.
Title: Re: Videos on Elxis eBlog / Elxis content [SOLVED]
Post by: datahell on April 20, 2010, 08:52:58
Your mobile needs the <embed> tag, that's why the video does not play in eBlog.
I will use copy-paste the standard YouTube's code.

Code: [Select]
<?php 
/********************/
/* YOUTUBE REPLACER */
/********************/
static private function youTube_replacer($matches ) {
    
$videoid $matches[1];

$out "<div>\n";
    
$out .= &#39;<object type="application/x-shockwave-flash" style="width:480px; height:360px;" data="http://www.youtube.com/v/&#39;.$videoid.&#39;&hl=en&fs=1&rel=0">&#39;."\n";
$out .= &#39;<param name="movie" value="http://www.youtube.com/v/&#39;.$videoid.&#39;&hl=en&fs=1&rel=0" />&#39;."\n";
$out .= &#39;<param name="wmode" value="transparent" />&#39;."\n";
$out .= &#39;<param name="allowscriptaccess" value="always" />&#39;."\n";
$out .= &#39;<param name="allowFullScreen" value="true" />&#39;."\n";
$out .= &#39;<embed src="http://www.youtube.com/v/&#39;.$videoid.&#39;&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="360"></embed>&#39;."\n";
$out .= "</object>\n</div>\n";
    
return $out;
}
?>

Title: Re: Videos on Elxis eBlog / Elxis content [SOLVED]
Post by: rentasite on April 20, 2010, 09:06:24

Confirmed and Solved 100%

For future reference: Use the code above from datahell.

Thanks!!  8)
Title: Re: Videos on Elxis eBlog / Elxis content [SOLVED]
Post by: webgift on April 20, 2010, 09:14:51
Finally ok everything's fine. ( Τέλος καλό όλα καλά )!!!
If i had had an iphone then i would have helped 100%.!!! :(
Title: Re: Videos on Elxis eBlog / Elxis content [SOLVED]
Post by: rentasite on April 20, 2010, 09:16:32

Time to get one. Mobile is the future  ;)