title: youtube data api 3 php ,how to get more than 50 video from a channel?
body: <p>I am working on one project which requirs to lists all videos from a channel using youtubedata api 3.0 but not from gdata(feed), the Api returns only 50 videos from channel, and  there is no reference to get more videos on developers.google. 
  Help.
  This is my code</p>
  
  <pre><code>&lt;?php
  
  require_once 'contrib/Google_YoutubeService.php';*/
  require_once '../upload/google-api-php-client/src/Google_Client.php';
      require_once '../upload/google-api-php-client/src/contrib/Google_YouTubeService.php';
  session_start();
  
  /* You can acquire an OAuth 2 ID/secret pair from the API Access tab on the Google APIs Console
    &lt;http://code.google.com/apis/console#access&gt;
  For more information about using OAuth2 to access Google APIs, please visit:
    &lt;https://developers.google.com/accounts/docs/OAuth2&gt;
  Please ensure that you have enabled the YouTube Data API for your project. */
  $OAUTH2_CLIENT_ID = 'sadsadsadasdsad';
  $OAUTH2_CLIENT_SECRET = 'sadsadsadasdasdasdasd';
  
  $client = new Google_Client();
  $client-&gt;setClientId($OAUTH2_CLIENT_ID);
  $client-&gt;setClientSecret($OAUTH2_CLIENT_SECRET);
  $redirect = filter_var('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'],
    FILTER_SANITIZE_URL);
  $client-&gt;setRedirectUri($redirect);
  
  $youtube = new Google_YoutubeService($client);
  
  if (isset($_GET['code'])) {
    if (strval($_SESSION['state']) !== strval($_GET['state'])) {
      die('The session state did not match.');
    }
  
    $client-&gt;authenticate();
    $_SESSION['token'] = $client-&gt;getAccessToken();
    header('Location: ' . $redirect);
  }
  
  if (isset($_SESSION['token'])) {
    $client-&gt;setAccessToken($_SESSION['token']);
  }
  
  if ($client-&gt;getAccessToken()) {
    try {
      $channelsResponse = $youtube-&gt;channels-&gt;listChannels('contentDetails', array(
        'mine' =&gt; 'true',
      ));
  
      $htmlBody = '';
      foreach ($channelsResponse['items'] as $channel) {
        $uploadsListId = $channel['contentDetails']['relatedPlaylists']['uploads'];
  $pageToken=1;
    while($pageToken&lt;=25){
        $playlistItemsResponse = $youtube-&gt;playlistItems-&gt;listPlaylistItems('snippet', array(
          'playlistId' =&gt; $uploadsListId,
          'maxResults' =&gt; 50,
  
           ));
  
  
        $htmlBody .= "&lt;h3&gt;Videos in list $uploadsListId&lt;/h3&gt;&lt;ul&gt;";
        foreach ($playlistItemsResponse['items'] as $playlistItem) {
          $htmlBody .= sprintf('&lt;li&gt;%s (%s)&lt;/li&gt;', $playlistItem['snippet']['title'],
            $playlistItem['snippet']['resourceId']['videoId']);
        }
        $htmlBody .= '&lt;/ul&gt;';
      }
    }
    } catch (Google_ServiceException $e) {
      $htmlBody .= sprintf('&lt;p&gt;A service error occurred: &lt;code&gt;%s&lt;/code&gt;&lt;/p&gt;',
        htmlspecialchars($e-&gt;getMessage()));
    } catch (Google_Exception $e) {
      $htmlBody .= sprintf('&lt;p&gt;An client error occurred: &lt;code&gt;%s&lt;/code&gt;&lt;/p&gt;',
        htmlspecialchars($e-&gt;getMessage()));
    }
  
    $_SESSION['token'] = $client-&gt;getAccessToken();
  } else {
    $state = mt_rand();
    $client-&gt;setState($state);
    $_SESSION['state'] = $state;
  
    $authUrl = $client-&gt;createAuthUrl();
    $htmlBody = &lt;&lt;&lt;END
    &lt;h3&gt;Authorization Required&lt;/h3&gt;
    &lt;p&gt;You need to &lt;a href="$authUrl"&gt;authorize access&lt;/a&gt; before proceeding.&lt;p&gt;
  END;
  }
  ?&gt;
  
  &lt;!doctype html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;YouTube Search&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;?=$htmlBody?&gt;
    &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>