YouTube Application Program Interface (API)

YouTube is the most popular video source for world wide web users. As a developer, if you would like to embed a YouTube application in your website or application, there are a number of tools available. However, there are some settings and customization required if you want to modify according to your requirements. Here are my insights.

YouTube API

To incorporate YouTube API into your website you will first need a security key or API Code. You can create one for your project by creating a google account if you don’t already have one.

  • After logging in to the Google Developers Console, create a new Project by giving title and description
  • Add corresponding API’s to your project by selecting YouTube Data API’s to start with
  • Create a security key for your project using the left menu for the domain
  • You can also create a OAuth key if required and add the domain and referrers




Connecting to YouTube

On the Google Developers YouTube page, there are scripts available in different programming languages such as Java, JavaScript, PHP, Python, and so on. You can follow the guidelines there to create the pages. If you are using JavaScript, you can create separate java script files and html file as given. However, you can include everything in one html page separating the scripts.

In the code replace the existing sample text with your security key that you generated earlier. Try running the code in a browser and everything must work fine. However, the console may show certain errors such as ‘cannot find property of undefined’ and so on. Start debugging the code and see where the error is occurring.

In most cases, the security key is incorrect or if you are trying to connect from a http to https websites. In other cases, the errors pop up due to the x-frame origin set to the sameorigin. If you check the response of the gapi, you can see the json response and all the resulting video lists.

Search.List

YouTube API has a function search.list which is used to search the youtube videos and get a response. You need to specify a search string and return type. Also, the maxResults or safeSearch options can be set based on your preferences.

Once you get the response json, the next step is to embed the video code of each video in to the iframe player on your html. You can use a player for web,ios, or andriod applications based on your device. Create an id to the iframe and set the source of the iframe to the youtube video code onclick of the video title. You can have a function to append code to the source url. In addition to displaying the video title, you can also display additional details about the video such as the thumbnail image from the json.

Other YouTube Functions

There are other functionalities that you can include in your website such as uploading a video, creating or modifying a playlist, searching a channel, downloading a video, getting the videos from users channel, and so on. The code is already there in the Google Developers, but the rel challenge lies in how you incorporate into your application. It also depends on how you customize the code and also taking care that your application does not crash due to the YouTube API. You also need to take care of the minimum units available per day and always upgrade more depending on the use.

Picking Up High School Courses

Okay, its the time of the year where schools send reminders about picking up high school courses. If you have a child or dependent who is in high school, you will feel the pain or pressure of picking the courses. Ideally, the student is supposed to pick the course, but most parents tend to get confused about which ones are best for your child. Here are some tips from my perspective.

Objective

The main objective of choosing courses in high school is to let the student decide their future. However, the schools have their own way of limiting the students so you have to follow their guidelines. If your child is planning for a college or university, the objective of the high school courses is to meet the college requirements. Th current courses which the student takes will highly determine which college or course they are going to take in college or future. Of course, there is always a chance of dropping the class if they don’t like it. But, it is not advisable as it will not give you the credit or departmental honors in the respective division. So, planning way ahead is mandatory.

Graduation Requirements

Most high schools have minimum number of credits required to graduate from high school. Those vary from 20 to 25 or higher. Any additional credits, it is the students choice. But, in general high schools require 4 years of Math, 4 years of English, 3 years of Social Studies, 2 or 3 years of Science, 4 years of PE, and so on. In addition, Consumer Education or Volunteering may be must. They may also provide two or three Electives. In general, these requirements match the respective state university or community colleges.

Choosing the Courses
It is really amusing how the schools set conditions about choosing the courses. I think they customize the conditions based on their 5 year plans. Also, the schools are highly selective about which students take which courses. Before approving any course, they make sure the students meet certain requirements or test scores.

There are hundreds of courses a school offers under different departments. But, the student is left with only minimum choices after selecting the mandatory courses. The student must select the electives in a manner that his college requirements are met. Dual Credit courses offered at local community colleges might be a good idea to carry the credit to both high school and the college

Choosing orchestra in high school is highly selective. Even though orchestra is considered to be an easy grade, there might be many hours required for each concert. If you take orchestra, it will show your commitment to follow directions and work in teams. Also, it is better to take for four years which show your perseverance over a period of time. The same applies for choir or band.

Choosing a world language is also a big question for many students. Most colleges require a world language as their prerequisites. So, the student is forced, in a sense, to participate in a world language hoping to be useful in future profession. Again, it is suggested that they take the world language for four years in high school.

Students must be watchful about the courses the schools set as mandatory to be selected for a class rank. If you need to be considered for a class rank, you have to take the courses set by the school. Else, you will not have a school rank on your final transcripts! Not fair, huh. 🙂

Clubs and Sports

After the courses are selected you will be given option to take participation in Academic clubs, Debate teams, Student Leadership, and so on. Similarly, it is suggested that you be a member of some school’s sports team of your choice. This will showcase you as an ‘overall candidate’ when you apply for college.

Finally, it is essential the student put in lot of work hours after school to study all the subjects they signed up for. Good work ethics and practice is suggested for success in secondary school that lays foundation for college and future!