Skip navigation

First Draft

Help

First Draft

Hello Uwe

I've finished the first draft of the module. I have installed it in a system which you can access at http://uwe.jaypan.com . My system should have already sent you login information (please let me know if you didn't receive it). I have created your account as an administrator account, so you can play with it however you want.

Setting up the module is a two step process. You have to add a field to the content type you want to use, then you have to tell my module to use that field on the module settings page. Specific directions are as follows:

  1. Create a content type for uploading videos (or use a pre-existing type)
  2. Add a new field to the content type of type of type 'Multimedia asset' with a widget of type 'Media file selector'
  3. In the widget settings, under 'Allowed remote media types', ensure that the 'video' checkbox is checked.
  4. Under 'Allowed URI schemes', select 'youtube:// (YouTube videos)'.
  5. Save the settings
  6. Navigate to Configuration -> Media -> Youtube node (admin/config/media/youtube_node)
  7. Enter your youtube email, password and developer key
  8. For the content type you created in step 1, check the 'enable' box
  9. For that content type, in the 'Attach to' column, select the field you created in steps 2-4
  10. Save the page

Next is time to create a node. Originally, I started to set it up with the direct upload method, which has a slightly friendlier user interface as the user can upload the file and meta data all in one step. However, I decided not to use this method for two reasons:

  1. This method required uploading the file once to the Drupal server, then the Drupal server had to send the video to the YouTube server. This meant that it took twice the time for the user, since the video is essentially being sent twice.
  2. The video was stored on the Drupal server for at least six hours, until a cron run cleaned it out. This could potentially put you/other users over their storage limit, and increase overall bandwidth.

I decided that these two negatives were enough to sacrifice a bit of usability in using the browser upload method (which is what you had originally asked for anyways).

 

So to create a video, the workflow is as follows:

  1. The user creates a new node. They choose the youtube settings while creating the node. If the youtube video was not set to required, the user must check the 'Upload video to youtube' box. If this box is not checked, the user will not be able to upload a video in the next step.
  2. The user saves the node, and is brought to the node display page. On the node display page is an upload element for a file. The user selects the video file, and clicks submit.
  3. The video is submitted to youtube, and the user is redirected back to the node page. At this point, the system associates the node with the submitted video. After a short period of time during which youtube does video conversions, the video becomes available to the user.

 

Not yet done:

  • No 'edit' functionality has been created yet
  • No 'delete' functionality has been created yet

Questions I need to know to finish:

  • What do you want to happen when the user edits the node?
  • What do you want to happen when the node is deleted?

 

Thanks Uwe, I look forward to your responses. I'll be out of the office all day tomorrow, however I will probably answer any reply you make to the site here.

Jay

#1

Hi Jay,

thanks for getting the demo done so quickly.

I was able to upload a video to my youtube account http://www.youtube.com/watch?v=CddEKD29Pn8

and it linked back to the node display, very cool!

http://uwe.jaypan.com/node/13

It doesn't play on that page, not sure why. I'm not familar with the media module.

I'm assuming you are just using the media module to display the saved youtube url?

I'm using the youtube_video_embed module. Is your code just saving the youtube url to the node field?

On my site I won't give the user the ability to change the youtube settings (I use global settings for all), but that's easy to comment out.

In terms of workflow, what about saving the node initially as "unpublished" and then when the youtube callback has been received changing it to published? That way we won't have "stray" nodes with unsaved videos.

I don't need a special "delete" feature right now. If you have time (I don't want to increase the scope), it would be nice to have the youtube video set to private.

It would be great to be able to edit the node and click a "upload a new video" link or button, this would save the node and the user would get another new upload box on the node display box. When youtube posts the video reponse the original video url gets overwritten, otherwise nothing happens.

Thanks again, I'm very impressed by your professional work and am looking forward working with you on future projects!

UWE

 

 

#2

Hello Uwe

I got the module you were using mixed up! I actually couldn't figure out how to get the video to play either - I figured you would know how to configure it. I guess not! haha. Let me know, is it an absolute requirement to you to use the module you mentioned, or if there is a way to get this one to play the video instead of just linking to it, would you be ok with that? If you need it to be the youtube_video_embed module, or if the module I integrated with doesn't have a display method, then I'll switch the integration to work with your module.

I can set up the update functionality, and I'll have to add a delete method - I don't feel comfortable having a module out there that I've created without full CRUD functionality! I don't like putting out work that I'm not proud of! haha.

I'm out of the office today, so take your time with the response, and I'll get back to you tomorrow.

 

Jay

#3

Hi Jay,

the video_embed_field module is a very basic module but worked well for me. I asked in their issue queue about updating the video from another module and got this response:

I think what you're going to need to do is create a menu hook that does something like load the node which you want to attach the video to and set the url part of the video embed field to something like 'http://www.youtube.com?v=(id)' and then call node_save on it. That should get video embed field to do all its normal stuff (like download the thumbnail).

If at all possible I would like to use that module. The media module isn't ready yet for production sites and it would also be to big of a module to solve this specific task (validate and save the youtube url and download the thumbnail).

For the "delete method" I'm ok to use the node delete feature. If you want to add an option to "remove the youtube" video that would be fine with me.

thanks again

UWE

 

#4

Hi Uwe

It's no problem to change it to the video_embed_field - but if it wasn't necessary, I didn't want to do it. I'll adjust it and get back to you when I've got everything going.

Jay

#5

Hello Uwe

I've altered the module to work with the video_embed_field module, and I added update and delete funcitonality to the nodes.

The instructions are mostly the same as previous:

  1. Create a content type for uploading videos (or use a pre-existing type)
  2. Add a new field to the content type of type of type 'Video Embed' with a widget of type 'Video'
  3. In the widget settings, do not select inclusion of the description, as the 'Body' field for the node will provide this.
  4. Save the settings
  5. Navigate to Configuration -> Media -> Youtube node (admin/config/media/youtube_node)
  6. Enter your youtube email, password and developer key
  7. For the content type you created in step 1, check the 'enable' box
  8. For that content type, in the 'Attach to' column, select the field you created in steps 2-4
  9. Save the page

You can now attach videos in the same was as previously, and they actually play now!

Please test it out and let me know what you think.

Jay

#6

Hi Jay,

that's great, thank you. I could upload the video and then play it (after it had finished processing).

Unfortunately, the video thumbnail hasn't been processed at the time youtube responds back with

the video URL, resulting in a "default" thumbnail:

http://uwe.jaypan.com/sites/uwe.jaypan.com/files/video_embed_field_thumb...

Not sure if there is an easy way around that, other than requesting it again at a later time?

How about saving the node as "unpublished" and then doing a cron job that turns all unpublished videos (older than x minutes) that have a youtube url into published while updating the thumbnail (by resaving the youtube url)? That would also solve the problem of the user never uploading a youtube video.

I understand that that might be out of the original scope. I think I have enough to work with and you clearly solved my original youtube upload problem ;-)

thanks again for the great work and the quick turnaround, it's been a pleasure working with you.

What other areas of Drupal work do you specialize?  I'm just launching my motorcycle community website and have a lot more issues to tackle.

UWE

 

#7

Hello Uwe

Unfortunately, setting up a system to grab the thumbnail at a later time is beyond the scope of our project. I'd have to re-structure a lot of the code, and integrate it into a cron run, which would be a fair bit of extra work. I'm happy to do this if you would like, but it will of course require a separate agreement from our current one!

As for what areas of Drupal I specialize in - I'd have to say most of them! I do have a few holes with some contributed modules, most specifically Panels (never used it, don't know how to integrate with it), but I'm pretty comfortable in pretty much all areas of Drupal other than that. There isn't a lot I can't do with it, and eventually if/when a project comes up that has Panels on it, I'll figure that out as well!

I can build themes, modules, AJAX applications, you name it. I know all of the major APIs, and I have a good sense of how everything fits together. I think you can probably see this with the module I've built!

Anyways, if you are happy with the module as is, then please make the final payment through paypal, and I'll zip it up and post it up here for you as soon as I have confirmed that payment.

I'm glad you are happy with the product!

Jay

#8

Hi Jay,

sounds great. I just paypaled you the remainder.

I'm about to launch the site by the end of the month and will then add more features like Facebook integration, mapping and more. I want to make the the site behave a lot more like Facebook from an UI standpoint.

Do you have experience with TinyMCE? I want to be able to have the user select a photo or video button to embed previously uploaded photos and videos into the text. 

I also would like to be able to embed links into the text that would automatically change to a "preview", just like Facebook does.

 

Thanks again

UWE

 

 

 

#9

Hi Uwe

Thank you for making payment. I have attached the module to this post. My site decided that for security reasons it needed to rename the file, so it's possible that you will need to change the name to youtube_node.tar.gz before you can unzip it.

I will fix any bugs that arise within the next 30 days free of charge. This means any errors that occur as a result of coding in my module. If the errors arise due to changes in 3rd party modules that my module depends on, these will not be covered under this offer. Changes in workflow and/or additional functionality also are not covered under this offer.

Unfortunately I have very little experience with TinyMCE. I used it on a site about five years ago, but haven't touched it since. I use CKEditor myself.

I may be able to work with your facebook preview, but I'd have to do a proof of concept first to check and see if I can work with the textarea that has tinymce loaded into it or not. I know I could do it with a plain textarea, but WYSIWYG editors can sometimes make things difficult.

Finally a couple of other points. I was looking back at our intial talks, and you asked if I'd put up the module on Drupal.org with a 'sponsored by' link to you. Unfortunately, this is more of a commitment than I can offer. Maintaining a module is a large commitment, and in all honesty I've not been meeting that commitement on the modules I already host on Drupal.org - I've got to cover my rent every month before I start thinking about the free work!

I also have a request. I actually quite misjudged the amount of time it would take me to develop this module, due to some issues I ran into when dealing with the youtube API. It ended up taking 2.5 times as long as I originally estimated. This is my own problem, which is why I didn't mention it to you until we had concluded our agreement. But as I'd like to try to to recoup some costs for my time, with your permission, I'd like to approach another user who was looking for this functionality and offer to sell them a copy of the module as well. Due to the Drupal license, I could actually do this without your permission, but I find that to be bad business as nothing along these lines were mentioned in our original agreement. So if you would prefer I don't approach this other user, I will not, but if you are ok with it, I would like to see if they are interested.

Regards,

Jay

PreviewAttachmentSize
youtube_node.tar_.gz6.35 KB

#10

Hi Jay,

sure no problem. Are you ok if I post the module and give you the credits for building it?

I don't want to maintain it either, don't have the time right now but would love to see Drupal community to be able to use this, video upload to youtube is such a basic feature.

I'll contact you about the Facebook embed POC once I have the site launched with TinyMCE

all the best,

UWE

 

Post new comment
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <div> <span> <br> <a> <em> <strong> <cite> <code> <strike> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <p> <pre> <h1> <h2> <h3> <h4> <h5> <h6> <table> <caption> <thead> <th> <td> <tr> <sup> <sub>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
Notifications
Jay
Uwe Druckenmueller
Attach files to this comment
Changes made to the attachments are not permanent until you save this post. Files must be smaller than 200 MB and have one of the following extensions: au avi bzip2 csv doc docx flv gif graffle gz htm html iso jpeg jpg kml kmz mov mp2 mp3 mp4 odp ods odt pages patch pdf png pps ppt pptx psd rar svg swf template tif tgz txt vsd wav wmv xls xlsx zip.
Content
Need help?

Blog

The blog lets your team communicate by posting updates and discussing issues. It is a great place for sharing progress, discussing challenges, and exploring ideas.