Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6971049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:47:20+00:00 2026-05-27T16:47:20+00:00

I would like to add a video to a playlist using GData. So I

  • 0

I would like to add a video to a playlist using GData. So I have no problem creating the playlist, but I can’t manage to add a video to it.
Here’s what I do:

$playlist = $yt->newPlaylistListEntry();
$playlist->summary = $yt->newDescription()->setText("test");
$playlist->title = $yt->newTitle()->setText("test2");

$postLocation = 'http://gdata.youtube.com/feeds/api/users/default/playlists';

$yt->insertEntry($playlist, $postLocation);

$feedUrl = $playlist->getPlaylistVideoFeedUrl();

$videoEntryToAdd = $yt->getVideoEntry(..given id here..);
$newPlaylistListEntry = $yt->newPlaylistListEntry($videoEntryToAdd->getDOM());
$yt->insertEntry($newPlaylistListEntry, $feedUrl);

And I get the following error:

Notice: Trying to get property of non-object in C:…\library\Zend\Gdata\YouTube\PlaylistListEntry.php on line 296

Which is caused by this code:

$feedUrl = $playlist->getPlaylistVideoFeedUrl();

var_dump shows that the $feed_url is NULL. And it shows that $playlist is an object Zend_Gdata_YouTube_PlaylistListEntry, so I can’t understand why it writes “property of non-object”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:47:20+00:00Added an answer on May 27, 2026 at 4:47 pm

    It seems like it is some kind of a bug in the API. So I’ve made a little workaround. It may seem ugly, but I had no other ideas.

    function grab_dump($var)
    {
        ob_start();
        var_dump($var);
        return ob_get_clean();
    }
    
    function getPlayListLink($playlist) {
        $test = grab_dump($playlist);
        $test = strstr($test, "http://gdata.youtube.com/feeds/api/playlists/");
        return strstr($test, "' countHint='0'", TRUE);
    }
    
    function addVideosToPlaylist($videos_arr, $playlistEntry, $yt) {
        $feedUrl = getPlayListLink($playlistEntry); 
    
        foreach($videos_arr as $video)
        {
            $videoEntryToAdd = $yt->getVideoEntry($video);
            $newPlaylistListEntry = $yt->newPlaylistListEntry($videoEntryToAdd->getDOM());
            $yt->insertEntry($newPlaylistListEntry, $feedUrl);
        }
    }
    

    And simply call it like that:

    addVideosToPlaylist($vids_id, $playlist, $yt);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using RabbitMQ to have worker processes encode video files. I would like
I would like to add a DataGridViewTextBoxCell cell to a DataGridViewCell control, but as
I would like to add AES encryption to a software product, but am concerned
I would like to add one video to the main screen of my application
I have a client that would like to add a feature to their application
I am using VideoView to play an mp4 video. I would like to give
I know how to capture video on android device, but i would like to
I would like to add text dynamically to HTML5 video. Currently, this is achieved
I would like to add a video of a moving object to a background
Here is my problem : I would like to create a specific component with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.