google ajax search api ( youtube videoBar)

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Aug 2008
Posts: 3
Reputation: joemalaya is an unknown quantity at this point 
Solved Threads: 0
joemalaya's Avatar
joemalaya joemalaya is offline Offline
Newbie Poster

google ajax search api ( youtube videoBar)

 
0
  #1
Aug 20th, 2008
Hello guys,
I want to put youtube video bar in my website... and i already found the way to do it. Using google ajax search api. Google already provide the wizard to generate the code.
http://www.google.com/uds/solutions/wizards/videobar.html

The problem is, by default it shows only 4 videos for horizontal view. I am really having trouble to increase the video number.Can anyone suggest me any alternatives or some modifications.

code snippet
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!-- ++Begin Video Bar Wizard Generated Code++ -->
  2. <!--
  3. // Created with a Google AJAX Search Wizard
  4. // http://code.google.com/apis/ajaxsearch/wizards.html
  5. -->
  6.  
  7. <!--
  8. // The Following div element will end up holding the actual videobar.
  9. // You can place this anywhere on your page.
  10. -->
  11. <div id="videoBar-bar">
  12. <span style="color:#676767;font-size:11px;margin:10px;padding:4px;">Loading...</span>
  13. </div>
  14.  
  15. <!-- Ajax Search Api and Stylesheet
  16. // Note: If you are already using the AJAX Search API, then do not include it
  17. // or its stylesheet again
  18. -->
  19. <script src="http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-vbw"
  20. type="text/javascript"></script>
  21. <style type="text/css">
  22. @import url("http://www.google.com/uds/css/gsearch.css");
  23. </style>
  24.  
  25. <!-- Video Bar Code and Stylesheet -->
  26. <script type="text/javascript">
  27. window._uds_vbw_donotrepair = true;
  28. </script>
  29. <script src="http://www.google.com/uds/solutions/videobar/gsvideobar.js?mode=new"
  30. type="text/javascript"></script>
  31. <style type="text/css">
  32. @import url("http://www.google.com/uds/solutions/videobar/gsvideobar.css");
  33. </style>
  34.  
  35. <style type="text/css">
  36. .playerInnerBox_gsvb .player_gsvb {
  37. width : 320px;
  38. height : 260px;
  39. }
  40. </style>
  41. <script type="text/javascript">
  42. function LoadVideoBar() {
  43.  
  44. var videoBar;
  45. var options = {
  46. largeResultSet : !true,
  47. horizontal : true,
  48. autoExecuteList : {
  49. cycleTime : GSvideoBar.CYCLE_TIME_MEDIUM,
  50. cycleMode : GSvideoBar.CYCLE_MODE_LINEAR,
  51. executeList : ["ytfeed:most_viewed.this_week"]
  52. }
  53. }
  54.  
  55. videoBar = new GSvideoBar(document.getElementById("videoBar-bar"),
  56. GSvideoBar.PLAYER_ROOT_FLOATING,
  57. options);
  58. }
  59. // arrange for this function to be called during body.onload
  60. // event processing
  61. GSearch.setOnLoadCallback(LoadVideoBar);
  62. </script>
  63. <!-- ++End Video Bar Wizard Generated Code++ -->
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,600
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 462
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: google ajax search api ( youtube videoBar)

 
0
  #2
Aug 22nd, 2008
Maybe reading the GSVideoBar reference can help you in properly customizing your video bar. As for your problem, you can decrease the size of thumbnails or increase the dimensions of your DIV to get more than 4 videos per strip. For further tweaking please refer the official documentation and in case of queries post in the Google Ajax Search API user group to get a quick response.

Here is a sample snippet:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  4. <title>GSvideoBar Sample</title>
  5. <script src="http://www.google.com/uds/api?file=uds.js&v=1.0"
  6. type="text/javascript"></script>
  7. <link href="http://www.google.com/uds/css/gsearch.css" rel="stylesheet"
  8. type="text/css"/>
  9. <script src="http://www.google.com/uds/solutions/videobar/gsvideobar.js"
  10. type="text/javascript"></script>
  11. <link href="http://www.google.com/uds/solutions/videobar/gsvideobar.css"
  12. rel="stylesheet" type="text/css"/>
  13.  
  14. <style type="text/css">
  15. body, table, p{
  16. background-color: white;
  17. font-family: Arial, sans-serif;
  18. font-size: 13px;
  19. }
  20.  
  21. td { vertical-align : top; }
  22.  
  23. #videoBar {
  24. width : 100%;
  25. margin-right: 5px;
  26. margin-left: 5px;
  27. padding-top : 4px;
  28. padding-right : 4px;
  29. padding-left : 4px;
  30. padding-bottom : 0px;
  31. }
  32. </style>
  33. <script type="text/javascript">
  34. function LoadVideoBar() {
  35. var videoBar;
  36. var barContainer = document.getElementById("videoBar");
  37.  
  38. var options = {
  39. largeResultSet : true,
  40. horizontal: true,
  41. thumbnailSize : GSvideoBar.THUMBNAILS_LARGE,
  42. autoExecuteList : {
  43. cycleTime : GSvideoBar.CYCLE_TIME_MEDIUM,
  44. cycleMode : GSvideoBar.CYCLE_MODE_LINEAR,
  45. executeList : [ "ytfeed:most_viewed.this_week", "bud light",
  46. "ytchannel:fordmodels", "vw gti" ]
  47. }
  48. }
  49.  
  50. videoBar = new GSvideoBar(barContainer, GSvideoBar.PLAYER_ROOT_FLOATING, options);
  51. }
  52. GSearch.setOnLoadCallback(LoadVideoBar);
  53. </script>
  54. </head>
  55. <body>
  56. <div id="videoBar">Loading...</div>
  57. </body>
  58. </html>
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 3
Reputation: joemalaya is an unknown quantity at this point 
Solved Threads: 0
joemalaya's Avatar
joemalaya joemalaya is offline Offline
Newbie Poster

Re: google ajax search api ( youtube videoBar)

 
0
  #3
Aug 22nd, 2008
i found out that this lines of code is very useful

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var options = {
  2. largeResultSet : true,
  3. horizontal: true,

i changed it to

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var options = {
  2. largeResultSet : false,
  3. horizontal: true,
now i can have 8 videos huhu..
Last edited by joemalaya; Aug 22nd, 2008 at 5:43 am.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC