1
tank1955
Video Tube - YouTube search problem
  • 2009/9/18 0:23

  • tank1955

  • Module Developer

  • Posts: 276

  • Since: 2007/9/7 1


YouTube recently changed a few items contained in the JSON feed which affects the format Video Tube expects when searching YouTube videos. The results of search will appear but when you hover over an image it will change to a red X. That is because the Video ID code is incorrect.

We will be providing the corrected code to adapt to the format change when we release version 1.86 but for those who want the fix immediately here it is.

On line 112 of /modules/videotube/include/youtube.js you will find a function called 'getVideoId'.
Here is what the code looks like now in version 1.85
function getVideoId(url){
  var 
match url.lastIndexOf('=');
  if (
match) {
    
id url.substring(match+1);
    return 
id;
  }
}


Here is the code with the changes that will get things working again.
function getVideoId(url){
  var 
match url.indexOf('=');
  if (
match) {
    
id url.substring(match+1,match+12);
    return 
id;
  }
}


Login

Who's Online

330 user(s) are online (251 user(s) are browsing Support Forums)


Members: 0


Guests: 330


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits