0

I need to upload videos of my site to Youtube. From Load video to youtube when node save a few modules are introduced that do this.

But I need to do this using an API. I mean I don't want to use the modules interface, I need to have a special interface which is a simple checkbox in the node page of a video to post the video, once a user checks the checkbox.

The Youtube API module seems to be the appropriate module to do this, But I really have no idea of how to use this module. Using the APIs I can use a simple .php file, by calling it via AJAX, then post the video.

How can I do this? Is there any tutorial for Youtube API module?

1 Answer 1

1

Create a custom module, in mymodule.module use hook_node_update

function mymodule_node_update($node) {

  if (isset($node->field_checkbox[LANGUAGE_NONE][0]['value'])) { 
  // If field checkbox is set (not empty), then...

     // youtube api code goes here. 

  }

}

The Youtube API module seems to be the appropriate module to do this, But I really have no idea of how to use this module.

According to the Youtube API module project page:

This module is an API module, meaning that it in itself doesn't do anything

Therefore, all this module does is install libraries that you need in order to interact with the Youtube API, nothing more.

You need to read the Youtube API documentation from https://developers.google.com/youtube/documentation/ and learn how to code for youtube api.

2
  • 1
    I am exactly looking for the section // youtube api code goes here.
    – M a m a D
    Commented Jul 27, 2016 at 14:46
  • Well then read the Youtube API documentation. Didn't you say Using the APIs I can use a simple .php file you can use php in .module file...
    – No Sssweat
    Commented Jul 28, 2016 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.