Displaying videos from Youtube in Coppermine. - Page 15 Displaying videos from Youtube in Coppermine. - Page 15
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Displaying videos from Youtube in Coppermine.

Started by Nibbler, October 31, 2006, 03:42:27 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

forced


Nibbler

No idea sorry. I don't use windows. Only error I get with firefox is about loading http://www.halfmoonpub.co.uk/copper/halfmoon.css which does not exist. Try with the classic theme and no other modifications/javascript loaded.

bas123

Nibbler...

Well now I know I've followed the instructions correctly...

I just clicked on a video at http://www.halfmoonpub.co.uk/copper/displayimage.php?album=lastup&cat=0&pos=2

and got the same crash!!!

I reloaded the page and the music vid played, then I reloaded (refreshed) again, and it crashed.

On your site, the page seemed to load (thumbnail showing) but just before it completes, the crash occurs.

I am happy to provide any additional information you'd like to resolve this.

Nibbler

If it even crashes on my site then it's likely to be something wrong with your browser.

bas123

Well it's not MY browser... I have tested this on four different computers (three testers). One even checked in IE6 - OMG!  :-[

ALL have the same problem with IE and none with FF.

I see there are references to IE in the script so obviously you've attempted to address the modification working with that browser.

I'd be quite happy to look at any browser settings if you think that might help.

phill104

Your theme doesn't display properly at all in IE but looks fine to me in FF. So, as a test I installed valentines with this mod to my test server and it worked perfectly. It also works perfectly on one of my sites which is also bridged with joomla but using a custom theme of my own.

As this works with IE on my install but not with yours (as I get the error on yours in IE) then it must be either something in your install (such as your bridge, plugins or even your hosts PHP settings) interfering with it or you have done something wrong in your upload.php or theme.php file. I used the theme.php file that I uploaded for you earlier so that sort of rules that out.
It is a mistake to think you can solve any major problems just with potatoes.

bas123

Thanks for sticking with this guys... I appreciate it.

Quote from: phill104 on July 29, 2008, 11:47:34 PM
Your theme doesn't display properly at all in IE but looks fine to me in FF. So, as a test I installed valentines with this mod to my test server and it worked perfectly. It also works perfectly on one of my sites which is also bridged with joomla but using a custom theme of my own.

As this works with IE on my install but not with yours (as I get the error on yours in IE) then it must be either something in your install (such as your bridge, plugins or even your hosts PHP settings) interfering with it or you have done something wrong in your upload.php or theme.php file. I used the theme.php file that I uploaded for you earlier so that sort of rules that out.

1) The only concern I have about this is that when I go to http://www.halfmoonpub.co.uk/copper/displayimage.php?album=lastup&cat=0&pos=2 I get the same IE7 error.
2) I asked two other people to test this and they have the same results in IE7 and IE6. Obviously that then points possibly to A. The bridge, B. Other plugins or C. PHP settings.

So,
A) which bridge are you using? I have Bridge by mehdiplugins.com
B) Any thoughts on other plugins that would affect YouTube in Coppermine?
C) Here's all my settings:
Problem Description:
Coppermine/YouTube Issues


Diagnostic Information
Joomla! Version: Joomla! 1.5.3 Production/Stable [ Vahi ] 22-April-2008 22:00 GMT
configuration.php: Writable (Mode: 644 ) | RG_EMULATION: N/A
Architecture/Platform: Linux 2.6.18-53.1.14.el5PAE ( i686) | Web Server: Apache ( womenmotorcyclist.com ) | PHP Version: 5.2.5
PHP Requirements: register_globals: Disabled | magic_quotes_gpc: Enabled | safe_mode: Disabled | MySQL Support: Yes | XML Support: Yes | zlib Support: Yes
mbstring Support (1.5): Yes | iconv Support (1.5): Yes | save.session_path: Writable | Max.Execution Time: 1200 seconds | File Uploads:  Enabled
MySQL Version: 5.0.45-community ( Localhost via UNIX socket )

Extended Information:
SEF: Disabled (with ReWrite)  | FTP Layer: Enabled | htaccess: Not Implemented
PHP/suExec: User and Web Server accounts are the same. (PHP/suExec probably installed)
PHP Environment: API: cgi | MySQLi: Yes | Max. Memory: 32M | Max. Upload Size: 75M | Max. Post Size: 75M | Max. Input Time: -1 | Zend Version: 2.2.0
Disabled Functions:
MySQL Client: 5.0.45 ( latin1 )


Phill104, May I have the links to the installations you've referred to so I can see how my browser reacts?

Thanks
            

phill104

http://www.windsurf.me.uk/cpg133/displayimage.php?album=34&pos=8

Bridged with Joomla using the same plugin.

I cannot post the valentines one I did as it was only a test and is now back to its required theme.
It is a mistake to think you can solve any major problems just with potatoes.

bas123

Phill104, Yours (http://www.windsurf.me.uk/cpg133/displayimage.php?album=34&pos=8) plays OK...

However, http://www.halfmoonpub.co.uk/copper/displayimage.php?album=lastup&cat=0&pos=2

Crashes as do mine...

Are we using the same bridge?

Can you attach your upload.php? Maybe I missed something there...
If so, I assume all I'll need to change is the YouTube key - right?

Any other troubleshooting ideas?

QuoteYour theme doesn't display properly at all in IE
Can you be more specific? Do you mean Joomla Theme or Valentines?

I know there's some css issues where some screen resolutions push the maincolumn and right column down.

bas123

OK, I've done some experimenting to see if I could troubleshoot where the Internet Explorer problem lies.

Again, I am not the only one experiencing these crashes, so I know it's not my specific browser or its settings. And in as much as even Nibbler's video crashes in my IE.....  ???


  • To see if it was something to do with any Joomla 1.5.3 conflicts, I unpublished MOST of my Joomla modules (both left and right panels).
    • The result was that some of the videos actually did load, but most crashed the browser.


  • To see if it was a Bridge issue, I unbridged Coppermine with Joomla
    • The result was ALL videos loaded and played... So I know I've done the setup for YouTube in Coppermine correctly.
    • Oddly, the theme (Valentines) did not display properly in this mode. Header was there, but none of the theme images - Very stripped down & weird looking too.
    • Therefore, I don't believe it will be necessary to modify another theme such as "Simple Theme" with the YT changes.
:-\
I have to be honest... I don't exactly know what to conclude here...

Hopefully someone has some insight and can lead me to some sort of solution... I've found some very content specific YouTube Videos which would be a great asset in the gallery and encourage our members to participate even more in the gallery. I just cannot rule out the 33% +/- that use IE as their primary browser.

One thing it did learn for those using a bridge... When you unbridge, you loose all your "Group" permissions and have to reset them when you re-bridge!

tpr

Hi guys,
I did everything as instructed but my image/youtube uploads fail.

When i try to add an image (from a url) i get a message saying 0 files were uploaded with an error "File Name/URL"
When i try to add a video from youtube i just get the message saying 0 files were uploaded.

Please advise.

Guy N.

tpr


Nibbler


tpr

hi,
thanks for the answer nibbler,
I reinstalled the mod and now i get the following error :
Error message
1. http://www.youtube.com/watch?v=q57dduRO4fc   8Bad, unknown, or disabled dev_id specified

now when i follow the link to the youtube api i ger redirected (they switched to a new api).
in the new location i can choose between :
Client ID
Developer Key

but both do not seem to work.
is there anything i need to change ?

Nibbler

To update this mod for the new API, try the following:

find


if (preg_match('/youtube\.com\/watch\?v=(.*)/', $YT_URI, $matches)){

$vid = $matches[1];
                     
$xurl = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=xxxxxxxxxxx&video_id=$vid";
                     
$xdata = file_get_contents($xurl);

file_put_contents($CONFIG['fullpath'] . "edit/yt_$vid.xml", $xdata);

// todo: parse the xml properly
if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){

$thumbnail = $xmatches[1];

$rh = fopen($thumbnail, 'rb');
$wh = fopen($CONFIG['fullpath'] . "edit/yt_$vid.jpg", 'wb');


        while (!feof($rh)) fwrite($wh, fread($rh, 1024));

fclose($rh);
fclose($wh);
     
$escrow_array[] = array('actual_name'=>"youtube_$vid.jpg", 'temporary_name'=> "yt_$vid.jpg");

} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> $xdata);
}


change to


if (preg_match('/youtube\.com\/watch\?v=(.*)/', $YT_URI, $matches)){

$vid = $matches[1];
                     
$xurl = "http://gdata.youtube.com/feeds/api/videos/$vid";
                     
$xdata = file_get_contents($xurl);

file_put_contents($CONFIG['fullpath'] . "edit/yt_$vid.xml", $xdata);

// todo: parse the xml properly
//if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){

$thumbnail = "http://img.youtube.com/vi/$vid/0.jpg";

$rh = fopen($thumbnail, 'rb');
$wh = fopen($CONFIG['fullpath'] . "edit/yt_$vid.jpg", 'wb');


        while (!feof($rh)) fwrite($wh, fread($rh, 1024));

fclose($rh);
fclose($wh);
     
$escrow_array[] = array('actual_name'=>"youtube_$vid.jpg", 'temporary_name'=> "yt_$vid.jpg");

//} else {
// $YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> $xdata);
//}


Then find



// todo: parse the xml properly
preg_match('/<description>(.*)<\/description>/', $xdata, $xmatches);
$description = substr($xmatches[1], 0, $CONFIG['max_img_desc_length']);

// todo: parse the xml properly
preg_match('/<tags>(.*)<\/tags>/', $xdata, $xmatches);
$keywords = $xmatches[1];

// todo: parse the xml properly
preg_match('/<title>(.*)<\/title>/', $xdata, $xmatches);
$title = substr($xmatches[1], 0, 255);


Change to



// todo: parse the xml properly
preg_match("/<media:description type='plain'>(.*)<\/media:description>/s", $xdata, $xmatches);
$description = substr($xmatches[1], 0, $CONFIG['max_img_desc_length']);

// todo: parse the xml properly
preg_match('/<media:keywords>(.*)<\/media:keywords>/s', $xdata, $xmatches);
$keywords = $xmatches[1];

// todo: parse the xml properly
preg_match("/<media:title type='plain'>(.*)<\/media:title>/s", $xdata, $xmatches);
$title = substr($xmatches[1], 0, 255);


You don't need to sign up for any key with this new API.

tpr

Quote from: Nibbler on August 09, 2008, 06:45:30 PM
To update this mod for the new API, try the following:
You don't need to sign up for any key with this new API.

Thanks a lot mate,
saved my day ;)

sranje

New feature for this mod I found very recently an it's working:
Add fullsize video feature to embedded youtube videos.
I am still using the old version of the Nibblers youtube mod.

In you theme php

Find this line:

$pic_html = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'. $vid . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'. $vid . '&rel=0" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object><br />';

and replace with:

$pic_html = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'. $vid . '&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/'. $vid . '&fs=1&rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="350"></embed></object><br />';

The similar change can also be used for Nibblers new youtube mod code.
(this also removes related videos from displaying related videos once the video is finished playing "rel=0")
Enjoy...

bas123

And while we're at it...

If you want to modify the YouTube console with your site's template colors, you can add:
&color1=0xcc2550&color2=0xe87a9f
Where the colors conform to your Coppermine theme...

Mine are in the red/pink range...
So I modified the complete line as:
$pic_html = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'. $vid . '&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/'. $vid . '&fs=1&rel=0&color1=0xcc2550&color2=0xe87a9f" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="350"></embed></object><br />';

BTW, I apologize to Nibbler, Phill104, and any other interested party for not reporting sooner regarding the IE7 crashes that were discussed earlier...

At this point, where I was getting a crash maybe 90% of the time I opened a YT file for viewing... Now it happens maybe 5% which I can accept.

The solution was inadvertant on my part... I made a dramatic Joomla template reconfiguration regarding the position of the "right" module position, and the issue went away.

I believe there was a conflict between the whole coppermine bridge and how it was trying to push the right "div" or at least somehow conflicting for position. (I don't understand enough about this to know what exactly it was).

Anyway, Many other issues also went away that I had simply accepted including the admin config where the sections which expand and collapse were all opening up and couldn't collapse.


sarangan

Hi,
I just have modified the very first hack that can be found at the following URL: http://forum.coppermine-gallery.net/index.php/topic,37962.msg178982.html#msg178982

Everythings works like you mentioned there, but the title and caption are not pulled from YouTube. :(
thumbnail have been uploaded succesfully.

I am using the latest version of Coppermine gallery.

Please help me to fix that problem.

Thank you.

I have attached the modified theme.php and upload.php

josvh88

Hi all,
I tried to use this mod several times, but it never worked.
Maybe it didn't word due my youtube dev id, however I read that this ID isn't required anymore.
Is there someone on this forum who can post a working example of upload.php and theme.php without using the developer ID? I'm using the theme 'fruity' atm, don't know if it differs from the other themes..?

Thanks in advance,
Jos

PS: I'm sorry for my grammatical mistakes etc, me and the English language is like fire and water :').