[Embed Video] A simple module to embed youtube, google, or remote .flv videos

floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2007-07-11 03:47

I don't know much about youtube and permissions but I get this:

Quote:
This is a private video. If you have been sent this video, please make sure you accept the sender's friend request.

when clicking on the video.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Wed, 2007-07-11 05:26
Semanoff wrote:
I installed the plugin a couple days ago. Initially I was getting the same errors as noted above when trying to embed videos (Error_Bad_Path...) but was able to fix the problem by uninstalling, deleting the module folder, re-uploading the module and reinstalling.

Now, I'm able to embed the videos (youtube) but visitors are reporting play issues. The embeded video appears, but when clicking on PLAY the video stalls and freezes on the LOADING screen.

http://www.benanderica.net/gallery/main.php?g2_itemId=324

I experienced the problem myslef initially, but now the videos play fine for me. However, I'm now getting reports from visitors to the site that they are experiencing the same problem.

Any ideas?

I've been able to reproduce your problem by looking at your site URL. The problem you are facing has nothing to do with the embedvideo plugin. If you click on the Menu button in your embedded video player, you can copy the embed code directly from youtube. If you place this in a separate HTML file, it still has the same stuck on loading problem as the embedded code that embedvideo creates. The embedded code is identical, so this makes sense. If you click on the URL link, it won't let you see the video directly on youtube either because it is marked private. I don't know enough about youtube to know why the embedded code they provide directly (or through the embedvideo module) results in a video that won't playback properly. That is an issue you will need to take up with their tech support. The only idea I have for you is to mark the video non-private, and see if that fixes things. Good luck. Let us know what you find out!

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Wed, 2007-07-11 05:27
floridave wrote:
I don't know much about youtube and permissions but I get this:

Quote:
This is a private video. If you have been sent this video, please make sure you accept the sender's friend request.

when clicking on the video.

Youtube allows its users to mark videos as "private" when they are added to youtube. This is a flag that is settable and changeable per video uploaded to youtube. You are getting that error because a youtube video is marked in this fashion.

 
djbis

Joined: 2004-02-25
Posts: 64
Posted: Wed, 2007-07-11 15:45
apippin wrote:

To install it, download the zip file and unzip it to the modules directory. There is an Admin Option page for this module that allows you to configure various options, including adding your own youtube Developer ID if you are embedding youtube URLs. I'm interested in any feedback anyone has to offer on the module (and any bugs for that matter). The module itself is simple and flexible. There are still some things I am not fully happy with and hope to address in future releases (I'm sure there are others you will think of, but here is my short list):

1) no thumbnails for remote .flv file URLs that are embedded
2) the requirement to patch the GalleryUtilities.class to allow for editing of these items
3) overloading of the description field of a photo item with raw HTML to get all this to work properly
4) remote file "does not exist" error check (how can I check for the existence of a remote file without actually downloading it?)

I have a codex page created for this module located here: http://codex.gallery2.org/index.php/Gallery2:Modules:embedvideo

I also have a simple album demonstrating the different types of embedded videos this module supports adding:
http://www.pippins.net/gallery2/v/development/

For my installation, I had Gallery 2.2.1 installed. This was a single-site installation and I have no idea if it works for multi-site or even if there is any reason why it wouldn't!

Enjoy...

Is this the best utility for embedding youtube videos right now? Great work, it looks awesome. The fact that it works with FLV's and such is great as well.

I checked out your site and there I saw that you had two different players for FLV's, are these options within your module's design or is this something that I will have to learn how to do in a custom sort of a way?

Thank you, keep up the great work!

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Wed, 2007-07-11 17:40
djbis wrote:
Is this the best utility for embedding youtube videos right now? Great work, it looks awesome. The fact that it works with FLV's and such is great as well.

I checked out your site and there I saw that you had two different players for FLV's, are these options within your module's design or is this something that I will have to learn how to do in a custom sort of a way?

Thank you, keep up the great work!

A month ago, I looked long and hard to find existing utilities to embed youtube videos in Gallery. I came up empty handed after searching through all the forums. I decided to create this module to fill that hole. The embedvideo tool has a few parameters that you can specify that allow you to specify an external FLV player to use for embedded links to .FLV files. You would need to set the parameters in the following way:

useInternalFlvPlayer=false
externalFlvPlayer=<URL path to the external flv player (.swf) to use>
externalFlvPlayerVars=<flashvars= options for the external flash player>

If you look in my development album at the item that uses the external player, and view the HTML source of that webpage, you should be able to find the values I used in the fields above between the <embed>...</embed> tags in the webpage.

I will continue to improve the module as time permits, and new ideas/requests flow in. Thanks!

 
agarbato

Joined: 2007-07-13
Posts: 3
Posted: Sat, 2007-07-14 00:42

Hi apippin,

Your module is really nice. Thanks 4 all the hours you spent to develop it.
I'm trying to integrate it in my gallery.
No issue in video importing but I don't understand how to use internal/external flash player.
If I put the parameter useInternalFlvPlayer=true the google/youtube still appears.
Tried also with externalFlvPlayer and parameters (following the html source code in your web page) but nothing change.
Turned the debugging mode on shows correctly the parameters as set in the admin page.

There's one thing is not really clear for me.
The module works with html code as I can see in your development album.
The thumbnail link to html pages.

When the html page are generated? No html pages on my site..
The idems are imported in the gallery in normal behavior (eg :main.php?g2_itemId=7324)
In the source code of my site page the parameters are not what they should be for the external/internal flash player.

The module version installed on my system is the last, 1.04

Thanks in advance.
Andrea.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Sat, 2007-07-14 04:25
agarbato wrote:
Hi apippin,

Your module is really nice. Thanks 4 all the hours you spent to develop it.
I'm trying to integrate it in my gallery.
No issue in video importing but I don't understand how to use internal/external flash player.
If I put the parameter useInternalFlvPlayer=true the google/youtube still appears.
Tried also with externalFlvPlayer and parameters (following the html source code in your web page) but nothing change.
Turned the debugging mode on shows correctly the parameters as set in the admin page.

There's one thing is not really clear for me.
The module works with html code as I can see in your development album.
The thumbnail link to html pages.

When the html page are generated? No html pages on my site..
The idems are imported in the gallery in normal behavior (eg :main.php?g2_itemId=7324)
In the source code of my site page the parameters are not what they should be for the external/internal flash player.

The module version installed on my system is the last, 1.04

Thanks in advance.
Andrea.

I'm glad you like the module! Let me see if I can answer your questions. The useInternalFlvPlayer parameter only applies to videos that are added as URLs to remote .flv files. You can't change the player that is used for youtube, google, or other remote video server sites. We are forced to use their players to play their videos. But, if you want to link in a remote path to a remote .flv video file, the module will then check your useInternalFlvPlayer parameter. If it is set to true, it will use the internal gallery2 flash video player when playing back the remote .flv file. If it is set to false, it will use the externalFlvPlayer and externalFlvPlayerVars to control the <embed>..</embed> code it generates in the description field for a given video item. The HTML pages are generated on-the-fly when you click on a thumbnail image in gallery2. They aren't stored on your server anywhere. If you are looking at a page after you click on a thumbnail, then you are looking at HTML code. Any web browser will let you view the page's Source Code, so you can see the HTML code being generated for the page you are looking at in your browser. So, remember, the internal/external player thing ONLY applies to URLs that point to remote .flv files. It does not work with URLs that point to any of the remote video server sites. I hope that helps!

 
agarbato

Joined: 2007-07-13
Posts: 3
Posted: Sat, 2007-07-14 11:29

Thanks for your fast reply. All about exterl/internal flash player is clear now.

I use the siriux theme on the gallery and the result of importing embed video it's not really nice.

I'd like to move the video in the center of the page and remove the thumbnail from the photo pages.

An example from my gallery :

http://www.donidoni.it/photoupload/main.php?g2_itemId=7338

Why thumbnail it again in the "photo" menu if I've all the thumbnails in the album menu?

Thanks again and have a nice week-end.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Sat, 2007-07-14 18:01
agarbato wrote:
Thanks for your fast reply. All about exterl/internal flash player is clear now.

I use the siriux theme on the gallery and the result of importing embed video it's not really nice.

I'd like to move the video in the center of the page and remove the thumbnail from the photo pages.

An example from my gallery :

http://www.donidoni.it/photoupload/main.php?g2_itemId=7338

Why thumbnail it again in the "photo" menu if I've all the thumbnails in the album menu?

Thanks again and have a nice week-end.

I understand what you are saying. Unfortunately, since I am "overloading" the photo item to be a video item, there is nothing I can do about the formatting of the page. That is all handled directly by gallery2, and is out of the control of my module. Until I complete the work (as noted in the feature request list) to stop using the photo item to embed videos by creating a new kind of object that will be created/instantiated instead specific to embedded videos, these types of issues can't be addressed.

 
agarbato

Joined: 2007-07-13
Posts: 3
Posted: Sun, 2007-07-15 10:33

Thanks again good man. :)

I'm not a developer, I'm a system administrator so my html/php knowledge is really poor..

As a sysadmin I think there must be a solution :)

Bye!

 
djbis

Joined: 2004-02-25
Posts: 64
Posted: Sun, 2007-07-15 11:35
apippin wrote:
djbis wrote:
Is this the best utility for embedding youtube videos right now? Great work, it looks awesome. The fact that it works with FLV's and such is great as well.

I checked out your site and there I saw that you had two different players for FLV's, are these options within your module's design or is this something that I will have to learn how to do in a custom sort of a way?

Thank you, keep up the great work!

A month ago, I looked long and hard to find existing utilities to embed youtube videos in Gallery. I came up empty handed after searching through all the forums. I decided to create this module to fill that hole. The embedvideo tool has a few parameters that you can specify that allow you to specify an external FLV player to use for embedded links to .FLV files. You would need to set the parameters in the following way:

useInternalFlvPlayer=false
externalFlvPlayer=<URL path to the external flv player (.swf) to use>
externalFlvPlayerVars=<flashvars= options for the external flash player>

If you look in my development album at the item that uses the external player, and view the HTML source of that webpage, you should be able to find the values I used in the fields above between the <embed>...</embed> tags in the webpage.

I will continue to improve the module as time permits, and new ideas/requests flow in. Thanks!

Excellent work, all your help is appreciated. I will be hooking this up on my gallery in the near future. I will wait a little longer to see what other cool features you add to it.

 
rw712

Joined: 2007-07-15
Posts: 1
Posted: Sun, 2007-07-15 15:34

I installed, got my developer id, but am having a problem uploading/embedding. It gives the follow:

Error Detail -
Error (ERROR_STORAGE_FAILURE) : Unable to copy thumbnail from url: -

* in modules/embedvideo/ItemAddEmbedVideo.inc at line 515 (GalleryCoreApi::error)
* in modules/core/ItemAdd.inc at line 84 (ItemAddEmbedVideo::handleRequest)
* in main.php at line 231 (ItemAddController::handleRequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2.2
PHP version 5.1.6 apache2handler
Webserver Apache/2.2.4 (Fedora)
Database mysqli 5.0.27
Toolkits SquareThumb, ImageMagick, Thumbnail, NetPBM, Gd
Operating system Linux chocolate.epicminds.com 2.6.18-1.2849.fc6 #1 SMP Fri Nov 10 12:45:28 EST 2006 i686
Browser Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty)

I am trying to upload the following link:

http://www.youtube.com/watch?v=V4yhtS3Ers0

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Sun, 2007-07-15 22:09
rw712 wrote:
I installed, got my developer id, but am having a problem uploading/embedding. It gives the follow:

Error Detail -
Error (ERROR_STORAGE_FAILURE) : Unable to copy thumbnail from url: -

* in modules/embedvideo/ItemAddEmbedVideo.inc at line 515 (GalleryCoreApi::error)
* in modules/core/ItemAdd.inc at line 84 (ItemAddEmbedVideo::handleRequest)
* in main.php at line 231 (ItemAddController::handleRequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2.2
PHP version 5.1.6 apache2handler
Webserver Apache/2.2.4 (Fedora)
Database mysqli 5.0.27
Toolkits SquareThumb, ImageMagick, Thumbnail, NetPBM, Gd
Operating system Linux chocolate.epicminds.com 2.6.18-1.2849.fc6 #1 SMP Fri Nov 10 12:45:28 EST 2006 i686
Browser Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty)

I am trying to upload the following link:

http://www.youtube.com/watch?v=V4yhtS3Ers0

You have an interesting failure here. I know something isn't quite right by the "Unable to copy thumbnail from url: -" output. It is supposed to print out the URL to the thumbnail, and the HTTP Response it received by trying to copy it. I don't see either of those things in the debug output. This leads me to believe that the module was unable to extract the thumbnail URL from youtube. I tried using the module to add the link to the youtube video you provided, and it worked just fine. You'll have to post the .html page that is produced with the debugOutput parameter set to true. Right click on the webpage that is shown in debug mode, and save it as a local .html file on your system. Then, add it as a file attachment to your next post. If I could take a look at that, it might shine a better light on this. Does it do this for any youtube video you try to add?

 
rhythmace1

Joined: 2006-08-02
Posts: 4
Posted: Tue, 2007-07-17 02:06

I'd like to add my congratulations on the module, which is very useful. I'm looking forward to the development which doesn't rely on the hack; when this comes, one suggestion I have is to allow the embedding of YouTube playlists (eg http://uk.youtube.com/p/2D133BCB977E1A97) in addition to individual videos.

 
gdfwilliams

Joined: 2007-03-13
Posts: 20
Posted: Fri, 2007-07-27 02:52
apippin wrote:
rw712 wrote:
I installed, got my developer id, but am having a problem uploading/embedding. It gives the follow:

Error Detail -
Error (ERROR_STORAGE_FAILURE) : Unable to copy thumbnail from url: -

* in modules/embedvideo/ItemAddEmbedVideo.inc at line 515 (GalleryCoreApi::error)
* in modules/core/ItemAdd.inc at line 84 (ItemAddEmbedVideo::handleRequest)
* in main.php at line 231 (ItemAddController::handleRequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2.2
PHP version 5.1.6 apache2handler
Webserver Apache/2.2.4 (Fedora)
Database mysqli 5.0.27
Toolkits SquareThumb, ImageMagick, Thumbnail, NetPBM, Gd
Operating system Linux chocolate.epicminds.com 2.6.18-1.2849.fc6 #1 SMP Fri Nov 10 12:45:28 EST 2006 i686
Browser Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty)

I am trying to upload the following link:

http://www.youtube.com/watch?v=V4yhtS3Ers0

You have an interesting failure here. I know something isn't quite right by the "Unable to copy thumbnail from url: -" output. It is supposed to print out the URL to the thumbnail, and the HTTP Response it received by trying to copy it. I don't see either of those things in the debug output. This leads me to believe that the module was unable to extract the thumbnail URL from youtube. I tried using the module to add the link to the youtube video you provided, and it worked just fine. You'll have to post the .html page that is produced with the debugOutput parameter set to true. Right click on the webpage that is shown in debug mode, and save it as a local .html file on your system. Then, add it as a file attachment to your next post. If I could take a look at that, it might shine a better light on this. Does it do this for any youtube video you try to add?

I was getting the error above, too, until I realized that I hadn't entered a YouTube developer ID. Get a developer ID by editing your Developer Profile in your YouTube account. Then, define your developer ID by including it as a variable in the Embed Video Settings (under Import) in Admin.

Great mod. Thanks for your hard work.

Has anyone figured out how to increase the default YouTube thumbnail size?? According to Google (as of 6/11), larger thumbnails are not yet available:
http://groups.google.com/group/youtube-api-basics/browse_thread/thread/591142f68d8e440a/7de61b1d40308e26?lnk=gst&q=thumbnail&rnum=9#7de61b1d40308e26

 
gdfwilliams

Joined: 2007-03-13
Posts: 20
Posted: Fri, 2007-07-27 14:51

How to Turn Off Embedded Related YouTube Videos

YouTube recently (06/07/07) introduced embedded related videos in their player by default. To turn off related videos, you can pass a variable through the call to YouTube: rel=0

In order to do so globally at my site, I edited the ItemAddEmbedVideo.inc file by changing this line:

Quote:
$description.= '<embed src="http://www.youtube.com/v/'.$video_id.$autoStartStr.'" ';

to this:

Quote:
$description.= '<embed src="http://www.youtube.com/v/'.$video_id.$autoStartStr.'&rel=0" ';

(I'm sure there's a more elegant solution (editable per video?), but this works for me.)

Example: http://www.alyandgreg.com/main.php?g2_itemId=4825

 
gdfwilliams

Joined: 2007-03-13
Posts: 20
Posted: Fri, 2007-07-27 14:50

And one suggestion:

(Qualifier: I'm only using this mod with YouTube videos. I have not tried with any other video services.)

In order to differentiate video from images in the album view, I have used the following .GIF as a watermark for my video thumbnails:

http://www.alyandgreg.com/images/water.gif

(Align the watermark bottom-left when you upload.)

For an example, see here: http://www.alyandgreg.com/main.php?g2_view=core.DownloadItem&g2_itemId=4826&g2_serialNumber=4

The only hitch here is that I have to apply this watermark manually. It would be great if we could define which watermark to use in the Embed Video Settings and automatically apply it to the thumbnails...

Again, thanks for your hard work on this mod.

 
gdfwilliams

Joined: 2007-03-13
Posts: 20
Posted: Fri, 2007-07-27 04:48

YouTube Thumbnail Sizes

I found that YouTube thumbnails were rendering at 112x112 instead of 150x150 like the rest of my thumbnails.

By default, YouTube's thumbnails are 130x97. This poses a problem because the resize function sizes up to the album setting (in my case 150). However, it only makes the WIDTH of the thumbnail 150 -- the HEIGHT then becomes 112 (as per the original aspect ratio). When the thumbnail is generated, then, it generates to 112x112.

To get around this, I removed the check of the album preferences and changed the default thumbnailsize to 201 (which will yield a HEIGHT of 150):

Quote:
$thumbnailSize = 150;
list ($ret, $preferences) =
GalleryCoreApi::fetchDerivativePreferencesForItem($item->getId());
if(!$ret) {
foreach ($preferences as $preference) {
if (preg_match('/thumbnail\|(\d+)/',
$preference['derivativeOperations'], $matches)) {
$thumbnailSize = $matches[1];
$debugString.="Found thumbnail size in album preferences: $thumbnailSize <br>";
break;
}
}
}

Delete all but the first line, and change THAT value from 150 to 201:

Quote:
$thumbnailSize = 201;

Doing so results in 150x150 thumbnails for YouTube videos. I am not using other video services -- I'm sure this will impact them adversely.

Hope that helps.

 
hippytyre

Joined: 2007-01-15
Posts: 8
Posted: Wed, 2007-08-01 19:06

I just tried to install this module and everything went fine until i tried to add the link from google video. Instead of adding the video i got this error.
Any help would be appreciated.

Thanks

 
gdfwilliams

Joined: 2007-03-13
Posts: 20
Posted: Wed, 2007-08-01 20:58

One more glitch that I noticed:

Once a YouTube video has been posted, the item can't be edited. (Well, it CAN be edited, but once it is, the embed code appears instead of the ebmedded video):

Here's an example:
http://www.alyandgreg.com/main.php?g2_itemId=4847

(I had posted the video without a problem, but edited the item to change the Photo Date and Time so it would appear elsewhere in the gallery.)

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Thu, 2007-08-02 01:11
gdfwilliams wrote:
YouTube Thumbnail Sizes

I found that YouTube thumbnails were rendering at 112x112 instead of 150x150 like the rest of my thumbnails.

By default, YouTube's thumbnails are 130x97. This poses a problem because the resize function sizes up to the album setting (in my case 150). However, it only makes the WIDTH of the thumbnail 150 -- the HEIGHT then becomes 112 (as per the original aspect ratio). When the thumbnail is generated, then, it generates to 112x112.

To get around this, I removed the check of the album preferences and changed the default thumbnailsize to 201 (which will yield a HEIGHT of 150):

Doing so results in 150x150 thumbnails for YouTube videos. I am not using other video services -- I'm sure this will impact them adversely.

Hope that helps.

Thanks for the insight, and the suggested code changes to fix the issue! I've captured this item in my feature request list. I'll see what I can do to come up with a clean way of dealing with this situation in a way that doesn't affect videos added from other video sites.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Thu, 2007-08-02 01:14
gdfwilliams wrote:
And one suggestion:

(Qualifier: I'm only using this mod with YouTube videos. I have not tried with any other video services.)

In order to differentiate video from images in the album view, I have used the following .GIF as a watermark for my video thumbnails:

http://www.alyandgreg.com/images/water.gif

(Align the watermark bottom-left when you upload.)

For an example, see here: http://www.alyandgreg.com/main.php?g2_view=core.DownloadItem&g2_itemId=4826&g2_serialNumber=4

The only hitch here is that I have to apply this watermark manually. It would be great if we could define which watermark to use in the Embed Video Settings and automatically apply it to the thumbnails...

Again, thanks for your hard work on this mod.

This is an excellent suggestion too! I've captured this request on my feature request list as well. I'll see what I can do to add watermarks automatically to the video thumbnail images if the user desires it.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Thu, 2007-08-02 01:16
gdfwilliams wrote:
How to Turn Off Embedded Related YouTube Videos

YouTube recently (06/07/07) introduced embedded related videos in their player by default. To turn off related videos, you can pass a variable through the call to YouTube: rel=0

(I'm sure there's a more elegant solution (editable per video?), but this works for me.)

This is another great idea. You've probably guessed the next thing I'm going to say too! Yes, I've added it to my feature request list. I can setup a global option that will enable/disable this affect. To provide per video settings will require the creation of the new GalleryEmbeddedItem to handle such properties per video.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Thu, 2007-08-02 01:21
gdfwilliams wrote:
One more glitch that I noticed:

Once a YouTube video has been posted, the item can't be edited. (Well, it CAN be edited, but once it is, the embed code appears instead of the ebmedded video):

Here's an example:
http://www.alyandgreg.com/main.php?g2_itemId=4847

(I had posted the video without a problem, but edited the item to change the Photo Date and Time so it would appear elsewhere in the gallery.)

This "glitch" is a known issue. I discuss this issue on the Codex (Wiki) page I created for this project. You can find the information here http://codex.gallery2.org/Gallery2:Modules:embedvideo. Because this module is still using the "embed videos via html in the description field of a gallery photo item", there is a patch that must be made to the GalleryUtilities.class if you want to edit the item after it has been added to your gallery. If you don't want to edit the item after it has been added to your gallery, no patch is required. The process of editing the item will remove the embedded markup in the description field if this patch is not made, and your site is not configured to allow for rawHTML in the description field. This gallery forum[1] post mentions the patch which consists of commenting out line 859 in GalleryUtilities.class. I believe this is the issue you ran into. Sorry!

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Thu, 2007-08-02 01:26
hippytyre wrote:
I just tried to install this module and everything went fine until i tried to add the link from google video. Instead of adding the video i got this error.
Any help would be appreciated.

Thanks

You've hit an internal Gallery issue. The line of code that is generating this error is the call to the GalleryCoreApi::addItemToAlbum() method. For some reason, this call is failing for you. It appears that Gallery2 is trying to tell you why this call is failing in the error message output. Unfortunately, since this error is occurring outside of the code I have written for this module, I can't give you any additional insight into why it is happening. Good luck!

 
DeBoro

Joined: 2007-08-02
Posts: 7
Posted: Thu, 2007-08-02 14:26

apippin gratz :) love the module

i'm new to Gallery, so my q may be a little from the other world :) but

apippin wrote:
The videos are showing at the top instead of where the picture normally shows due to the overloading of the description field to embed the video. This issue should be resolved once I complete the changes to make a GalleryEmbeddedItem object, and move away from using the description field to embed the video in a GalleryPhotoItem object like I do today.

do u still think it's possible to make class ItemAddEmbedVideo to extend GalleryRenderer,
soo it could render embeded video in apropreate place

doing soo by specifing new (ammmmm, well) mime types, for exmpl
video/x-google
video/x-youtube
video/x-yahoo
video/x-metacafe
video/x-remote

this way it's a few more case 'video/x-......':
in modules/core/classes/GalleryAnimationItem.class

and as a must a new field in data base
CREATE TABLE `gallery`.`g2_item` (
`g_id` int(11) NOT NULL,
`g_canContainChildren` int(1) NOT NULL,
`g_description` text,
`g_keywords` varchar(255) default NULL,
`g_ownerId` int(11) NOT NULL,
`g_renderer` varchar(128) default NULL,
`g_summary` varchar(255) default NULL,
`g_title` varchar(128) default NULL,
`g_viewedSinceTimestamp` int(11) NOT NULL,
`g_originationTimestamp` int(11) NOT NULL,

`g_embedURL` varchar(255) default NULL,
PRIMARY KEY (`g_id`),
KEY `g2_Item_99070` (`g_keywords`),
KEY `g2_Item_21573` (`g_ownerId`),
KEY `g2_Item_54147` (`g_summary`),
KEY `g2_Item_90059` (`g_title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

i'm not sure if it's real, the only thing (as i see) that could stop us from doing soo
is some kind of cheking by the Gallery if file truelly exists, and what it's mime type is
(the one that stored inside of a file, again if Gallery do checkes it's actual mime type)

 
DeBoro

Joined: 2007-08-02
Posts: 7
Posted: Thu, 2007-08-02 15:11

this way i do beleave we gona need an activaction and uninstal function in module.inc

smth like this <see attachment>

at this point i see (assuming we're ok whith mime)
mime type 'embedvideo/x-.....' is better too use
due to slq select function like
SELECT [GalleryDataItem::id]
FROM [GalleryDataItem]
WHERE [GalleryDataItem::mimeType]
LIKE "\'embedvideo/x-"

 
djbis

Joined: 2004-02-25
Posts: 64
Posted: Thu, 2007-08-02 21:55

This thread is making some serious progress... Apippin, I am dying to install this but I don't want to yet since it seems you are doing a lot of work to add more features.
Keep up the good work and let us know when the next release comes out. All the ideas above are phenomenal!

 
gdfwilliams

Joined: 2007-03-13
Posts: 20
Posted: Fri, 2007-08-03 03:27
apippin wrote:
gdfwilliams wrote:
YouTube Thumbnail Sizes

I found that YouTube thumbnails were rendering at 112x112 instead of 150x150 like the rest of my thumbnails.

By default, YouTube's thumbnails are 130x97. This poses a problem because the resize function sizes up to the album setting (in my case 150). However, it only makes the WIDTH of the thumbnail 150 -- the HEIGHT then becomes 112 (as per the original aspect ratio). When the thumbnail is generated, then, it generates to 112x112.

To get around this, I removed the check of the album preferences and changed the default thumbnailsize to 201 (which will yield a HEIGHT of 150):

Doing so results in 150x150 thumbnails for YouTube videos. I am not using other video services -- I'm sure this will impact them adversely.

Hope that helps.

Thanks for the insight, and the suggested code changes to fix the issue! I've captured this item in my feature request list. I'll see what I can do to come up with a clean way of dealing with this situation in a way that doesn't affect videos added from other video sites.

Currently, the resize routine sets the new thumbnail to the defined WIDTH. If the routine instead used that same value as the new HEIGHT, we'd resolve this issue easily. At a height of 150, the standard YouTube thumbnail is 201 pixels and ready to be cropped -- at the right height...

 
DeBoro

Joined: 2007-08-02
Posts: 7
Posted: Fri, 2007-08-03 07:26

i do belive this is where it would by right to add new parametr to store our embedURL and not to abuse discription field

we'll need to upgrade core by editing modules/core/classes/GalleryItem.class
at the very begining of GallaryItem class add

Quote:
/**
* URL for embed item
* @var string
*
* @g2 <member>
* @g2 <member-name>embedURL</member-name>
* @g2 <member-type>TEXT</member-type>
* @g2 <member-size>SMALL</member-size>
* @g2 <member-external-access>FULL</member-external-access>
* @g2 </member>
*/
var $embedURL;

and later in create function where are initiated other fields this add

Quote:
$this->setEmdedURL(null);

this is needed to make parametr Null by default to other Gallery items

next at the end of the class this add

Quote:
function getEmdedURL() {
return $this->embedURL;
}

function setEmdedURL($embedURL) {
$this->embedURL= $embedURL;
}

and as i've seen from others threads new core version in
modules/core/module.inc

Quote:
$this->setVersion(' next vesion index ');

i think all this adds is all we need to create new field in db and to be able to comunicate with it

 
matbor

Joined: 2006-07-09
Posts: 74
Posted: Tue, 2007-08-21 03:20

When I embed a video it give's you the thumbnail (Zoe and the rugby ball) and you can click on it and it will load the youtube video, but for some reason it leaves a invalid image box beow it, see attached image.

Matt.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Tue, 2007-08-21 14:02
matbor wrote:
When I embed a video it give's you the thumbnail (Zoe and the rugby ball) and you can click on it and it will load the youtube video, but for some reason it leaves a invalid image box beow it, see attached image.

Matt.

To everyone on the forum first: Sorry for the delay in getting back to the numerous posts that have been made over the past month. Summer vacations mixed in with a brand new baby boy, have taken away my "spare" time! (as you can imagine). I hope to get back to these posts very soon.

To Matt: Can you post the URL that takes me to the page showing the problem? I'm not sure what step in the process you are seeing this. The index page, or the photo page. You can also post the debug output of adding one of these videos to your site. I've posted those instructions/steps on the codex page for this project: http://codex.gallery2.org/Gallery2:Modules:embedvideo

 
UKtenpin.com

Joined: 2007-08-23
Posts: 2
Posted: Thu, 2007-08-23 00:24

Hi I am having this problem when trying to add an item. I have attached the page the output page with the debugging on.

Error Detail -
Error (ERROR_MISSING_OBJECT) : Missing object for 305

* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1887 (gallerycoreapi::error)
* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (gallerystorageextras::_identifyentities)
* in modules/core/classes/GalleryStorage.class at line 298 (gallerystorageextras::loadentities)
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (mysqlstorage::loadentities)
* in modules/core/classes/GalleryCoreApi.class at line 2251 (galleryentityhelper_simple::loadentitiesbyid)
* in modules/watermark/WatermarkOption.inc at line 96 (gallerycoreapi::loadentitiesbyid)
* in modules/core/ItemAdd.inc at line 146 (watermarkoption::handlerequestafteradd)
* in main.php at line 231 (itemaddcontroller::handlerequest)
* in main.php at line 94
* in main.php at line 83

Thank You for any help anyone can be.

Mike

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Mon, 2007-08-27 03:18

Mike,

Thanks for posting the detailed debug dump along with your error message. Unfortunately, this error message is not being produced by any line of code in my module. The Gallery subsystem is complaining about something. Your debug output clearly shows that the process made it pretty far before hitting the error. There is only 1 thing I can think of that will require you to modify the code on your end. My module has the following return line that might be communicating an error back to the original caller on line 605 of modules/embedvideo/ItemAddEmbedVideo.inc:

return array(null, $error, $status);

I never print what the value of $error or $status is prior to returning. I'd be interested to see what the output of the module produces before the error is displayed with the debug output shown. Can you add the following line above the return shown above?

print "filename: $url id: $newItem->getId() error: $error status: $status <br>";

I'm not sure how all that will look, but send me the resulting output once you have it. There is something else in the callstack that looks odd to me: "in modules/watermark/WatermarkOption.inc". I wonder if you have some watermark option enabled that is choking on the "embed video" item that has been added somehow? Does the item show up in your album after the error occurs? Other than that, I don't have any other insights to offer here.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Mon, 2007-08-27 12:40
matbor wrote:
When I embed a video it give's you the thumbnail (Zoe and the rugby ball) and you can click on it and it will load the youtube video, but for some reason it leaves a invalid image box beow it, see attached image.

Matt.

When viewing the items in the album, the album view appears to be showing the thumbnail AND the embedded video for a given album entry. The only reason I can think that this is happening is because your album is trying to show the "Title" as well as the "Description" in the album view page. Since the current version of the embed video module overloads the description field with the embedded video link, this would explain why showing the pictures description on the album page would cause the embed video link to appear. If you change the properties of the album to not show the description, this problem should be resolved.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Mon, 2007-08-27 12:42

Intentionally blank.

 
iosoft

Joined: 2007-04-17
Posts: 17
Posted: Thu, 2007-08-30 08:01

do this support SWF files ?
if NO, then please add this support also and make it a complete embeded solution for G2.

when adding a SWF remote file (http://www.coolitsystems.com/images/stories/test2.swf) I am getting this ERROR:

Error (ERROR_UNSUPPORTED_FILE_TYPE) : Unable to embed video from: http://www.coolitsystems.com/images/stories/test2.swf

* in modules/embedvideo/ItemAddEmbedVideo.inc at line 495 (GalleryCoreApi::error)
* in modules/core/ItemAdd.inc at line 84 (ItemAddEmbedVideo::handleRequest)
* in main.php at line 231 (ItemAddController::handleRequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2.2
PHP version 5.1.6 apache
Webserver Apache/1.3.37 (Unix) mod_jk/1.2.14 PHP/5.1.6 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.8a
Database mysqli 4.1.22-standard
Toolkits Gd
Operating system Linux server.inamdarinfotech.com 2.6.18-1.2200.fc5 #1 Sat Oct 14 16:59:26 EDT 2006 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Thu, 2007-08-30 12:57

You've been the first to request support for .swf files. I believe that file type would follow the same flow as the .flv file type in the code, so adding support for it would be trivial. I'll add your request to my feature list, and should be able to deliver support for it soon.

 
iosoft

Joined: 2007-04-17
Posts: 17
Posted: Fri, 2007-08-31 02:43

Thank you very much for your support.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Fri, 2007-08-31 02:58

I've just released a new version of embedvideo, version 1.0.5, and have attached it here. I know there are more feature requests out there, but this is certainly a good start. There's always more to come as time permits. Thanks!

Here are the release notes for 1.0.5:
- Added support to embed .swf file types.
- Added parameter to control disabling/enabling youtube related videos.
- Much improved thumbnail sizing logic.

 
diabolka

Joined: 2007-07-09
Posts: 8
Posted: Fri, 2007-08-31 18:58

Hi all:

I also am having issues with youtube embeds. I got my Developer ID and put it under Site Admin, Import and Embed Video. It is listed under the Defaults variable as youtubeDevID=putmynumberhere

I try to put the link it and get:
Error

An error has occurred.

Back to the Gallery
Error Detail -
Error (ERROR_CONFIGURATION_REQUIRED) : Invalid/missing YouTube developer ID:

* in modules/embedvideo/ItemAddEmbedVideo.inc at line 158 (GalleryCoreApi::error)
* in modules/core/ItemAdd.inc at line 84 (ItemAddEmbedVideo::handleRequest)
* in main.php at line 231 (ItemAddController::handleRequest)
* in main.php at line 94
* in main.php at line 83

System Information
Gallery version 2.2.2
PHP version 5.1.6 apache2handler
Webserver Apache/2.0.55 (Ubuntu) PHP/5.1.6 mod_ssl/2.0.55 OpenSSL/0.9.8b
Database mysql 5.0.24a-Debian_9-log
Toolkits ImageMagick, NetPBM, Gd
Operating system Linux 2.6.17-10-server #2 SMP Tue Dec 5 22:29:32 UTC 2006 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

The ID matches up exactly to the one on the Developer Profile page on youtube. Any advice would be greatly appreciated.

 
gdfwilliams

Joined: 2007-03-13
Posts: 20
Posted: Fri, 2007-08-31 19:35

Does your default variable actually read "youtubeDevID=putmynumberhere"? It shouldn't -- it should show your actual youtubeDevID.

If it does, delete that variable and re-enter it using the "new variable" fields [youtubeDevID] = [yourDevIDhere]

[EDIT] Re-reading your question, it looks like your fields are most likely defined correctly. It IS your DevID, not your YouTube username?

 
zi94sm65

Joined: 2006-07-25
Posts: 38
Posted: Fri, 2007-08-31 20:45

I am having the same sort of problem with setting a youtubeDevId. When i try to add the new variable by setting youtubeDevId=X21k354eT (not my real Id) the module never seems to set the variable. It does not get added to the listing of default variables at all. I tried emptying caches to no avail and am wondering if this could be file permissions problem? The variable never gets set so i always get the Error (ERROR_CONFIGURATION_REQUIRED) : Invalid/missing YouTube developer ID.

Any way to go into the gallery database directly and set this variable? I looked at my gallery database through phpMyAdmin but could not find where it is storing the embed video information.

 
diabolka

Joined: 2007-07-09
Posts: 8
Posted: Fri, 2007-08-31 21:16

Yes, it is my actual DevID ... I didn't want to put my real ID number so used that as an example. But yes, it is the ID that is listed in the Developer Profile.

 
gdfwilliams

Joined: 2007-03-13
Posts: 20
Posted: Sat, 2007-09-01 00:18

Weird. You could try setting that variable manually in ItemAddEmbedVideo.inc here:

$dev_id = $youtubeDevId;

Replace $youtubeDevId with your youtubeDevID, and see if that works. Not a fix, but my install is keeping track of my devID without a problem...

Did you have this module installed previously, or is this new release your first install?

GDW

 
zi94sm65

Joined: 2006-07-25
Posts: 38
Posted: Sat, 2007-09-01 02:31

OK, forcibly setting the variable as described above got it to work correctly for me, and i can now see youtube vids inside of my gallery.

I agree it's weird behavior; and Yes this was a first-time ever install of the module (latest release) into my version of gallery2 (specs listed below). Not sure if i would call it a module bug; as i'm more apt to believe it's some sort of web-server settings problem. I'll keep testing and report back if i ever discover what the problem was....

Gallery version = 2.2.2 core 1.2.0.4
PHP version = 4.4.7 apache
Webserver = Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.7 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a
Database = mysqlt 5.0.27-standard-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, LinkItemToolkit, SquareThumb, Thumbnail, Gd, Ffmpeg
Acceleration = none, none
Operating system = Linux 2.4.21-47.ELsmp #1 SMP Wed Jul 5 20:38:41 EDT 2006 i686
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419.2.1 (KHTML, like Gecko) Safari/419.3
Rows in GalleryAccessMap table = 107
Rows in GalleryAccessSubscriberMap table = 83
Rows in GalleryUser table = 4
Rows in GalleryItem table = 71
Rows in GalleryAlbumItem table = 6
Rows in GalleryCacheMap table = 0

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Tue, 2007-09-04 04:34

Just got back into town again from a family reunion, and caught up on these latest postings. Thanks for sending a response back to these questions gdfwilliams! I have never seen the module behave this way. Is this a general problem for folks installing the module for the first time? Or is this an isolated incidence? I've never heard of others hitting this problem. The EmbedVideo module code makes pretty standard Gallery2 calls to add/delete its variables. I'm not sure how to debug that code. You would need to instrument the EmbedVideoSiteAdmin.inc file with a lot of debug output to try and track where the problem is occurring in the set variable process. This module fundamentally calls the GalleryCoreApi::setPluginParameter() and getPluginParameter() methods to manage its variable list. Again, I'm not sure how to debug your problem unless additional debug "print" statements were added to the .inc file mentioned above. If you'd like to try this yourself, please let me know what you narrow it down to. If you'd like me to provide an instrumented .inc file, please let me know that as well.

 
UKtenpin.com

Joined: 2007-08-23
Posts: 2
Posted: Wed, 2007-09-05 00:54

Hi apippin,

Thank you for trying to help me with my problem. I had a big problem with our web host who lost our site so we had to re-upload all of the files.

On doing a fresh install of gallery and then installing your module next it worked first time out of the box (for want of a better phrase). So I can only guess it must have been a setting or something else that I have "messed" with that was causing the problem.

I will keep an eye on it and let you know if this surfaces again once I start changing the settings to work the way we need it. Just so you know if anyone else has the same problem.

Thanks again for the help and thank you for creating this module.

Mike

apippin wrote:
Mike,

Thanks for posting the detailed debug dump along with your error message. Unfortunately, this error message is not being produced by any line of code in my module. The Gallery subsystem is complaining about something. Your debug output clearly shows that the process made it pretty far before hitting the error. There is only 1 thing I can think of that will require you to modify the code on your end. My module has the following return line that might be communicating an error back to the original caller on line 605 of modules/embedvideo/ItemAddEmbedVideo.inc:

return array(null, $error, $status);

I never print what the value of $error or $status is prior to returning. I'd be interested to see what the output of the module produces before the error is displayed with the debug output shown. Can you add the following line above the return shown above?

print "filename: $url id: $newItem->getId() error: $error status: $status <br>";

I'm not sure how all that will look, but send me the resulting output once you have it. There is something else in the callstack that looks odd to me: "in modules/watermark/WatermarkOption.inc". I wonder if you have some watermark option enabled that is choking on the "embed video" item that has been added somehow? Does the item show up in your album after the error occurs? Other than that, I don't have any other insights to offer here.

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Mon, 2007-09-10 12:56
oltix wrote:
The only problem that I see is the fact that there is no space for adding title or description for the videos. For the videos from youtube this is not a big problem, cos it takes the titles from youtube (using API) but from Google Videos it takes nothing, but the video only.

I'm not sure I'm following your observation. The EmbedVideo module knows how to extract the Title of the video from the various video sites, including google video. Only YouTube has an API that allows it to be extracted cleanly, however, the module knows how to parse the Title from the URL of the embedded video from the other sites. The description is always set to the embedded video code required to show the video in Gallery2 + the description of the video from the video site. I just tried a Google Video URL a few minutes ago, and it added it just fine with the Title of the video being set to the title of the video on Google Video. However, it appears Google Video has changed it's HTML output so that the EmbedVideo script can't find the description of the video anymore to add to the Gallery description, so just the title extraction is working. Is this the fundamental issue you are seeing?

 
apippin

Joined: 2007-06-11
Posts: 190
Posted: Mon, 2007-09-10 13:11
oltix wrote:
The only problem that I see is the fact that there is no space for adding title or description for the videos. For the videos from youtube this is not a big problem, cos it takes the titles from youtube (using API) but from Google Videos it takes nothing, but the video only.

I've tried to fix the Google Site Description extraction, and I can't see a way to get it to work. Google Video has switched to a frame based approach to display the video. They've placed the description of the video in a frame that the GalleryCoreApi::fetchWebPage() call is unable to grab. So, at this time, I don't know how to get that information from Google Video given their new video webpage format that embedvideo has to parse. I'm open to other ideas that can work to get this information! Until then, it won't be able to extract the description from Google Videos. However, the title extraction appears to be working fine.