Giter Site home page Giter Site logo

Comments (15)

ahmedash95 avatar ahmedash95 commented on July 19, 2024 2

@joedawson Sorry .. it's my silly fault .. this is my code

$video = Videos::user()->findOrFail($id);
$video = Youtube::upload(public_path($video->video_file), [
    'title'       => $video->title,
    'description' => $video->description . ' .. read more [ '.$video->url.' ]' ,
]);
$video->update(['youtube_id' => $video->getVideoId()]);

so the second line I overwrite $video object from Videos to Youtube and call model $video->update method from $video Youtube Object.

now everything is working with version 2.0.0

from youtube.

joedawson avatar joedawson commented on July 19, 2024 1

No problem, thanks :)

from youtube.

arcanedev-maroc avatar arcanedev-maroc commented on July 19, 2024 1

I didn't see that, glad you solved the issue.

from youtube.

joedawson avatar joedawson commented on July 19, 2024

Hey @ahmedash95,

Before I get a chance to test this, are you up to date? v2.0.0 was released recently.

Also, what version of Laravel are you using?

Thanks

from youtube.

ahmedash95 avatar ahmedash95 commented on July 19, 2024

Oh .. I think my mistake is that I'm using laravel 5.3 and the latest release is for 5.4 I downgrade to 1.1.2.

from youtube.

joedawson avatar joedawson commented on July 19, 2024

Let me know how how get on, I'll add a note to the readme if it works on 1.1.2 for 5.3 :)

from youtube.

ahmedash95 avatar ahmedash95 commented on July 19, 2024

I will test it at night then tell you

from youtube.

ahmedash95 avatar ahmedash95 commented on July 19, 2024

@joedawson Hi Joe . unfortunately still have the same exception after downgrading .. but it uploads to youtube successfully

from youtube.

joedawson avatar joedawson commented on July 19, 2024

Awesome, thanks for confirming @ahmedash95 :)

from youtube.

arcanedev-maroc avatar arcanedev-maroc commented on July 19, 2024

Hi @ahmedash95,

I don't think there is an update method in Youtube instance.

If a method doesn't exists in the Youtube instance, this one is called: https://github.com/JoeDawson/youtube/blob/master/src/Youtube.php#L310

Hi @joedawson:

To solve this, you need to add more checks in the __call method:

/**
 * Pass method calls to the Google Client.
 *
 * @param  string  $method
 * @param  array   $args
 *
 * @return mixed
 */
public function __call($method, $args)
{
    if (method_exists($this->client, $method)) 
        return call_user_func_array([$this->client, $method], $args);

    if (method_exists($this->youtube, $method))
        return call_user_func_array([$this->youtube, $method], $args);

    throw new \BadMethodCallException(
        'The method called is not supported by this package: ['.$method.']'
    );
}

from youtube.

ahmedash95 avatar ahmedash95 commented on July 19, 2024

@joedawson weclome .. and thanks for your interesting

from youtube.

ahmedash95 avatar ahmedash95 commented on July 19, 2024

Hi @arcanedev-maroc , thanks for clarifying .. what makes me confused is it tells me there is no update method at Google_Client class .. so i started debugging where is Google_Client class .. then I started review my code from first.

Thanks again

from youtube.

arcanedev-maroc avatar arcanedev-maroc commented on July 19, 2024

@ahmedash95, Do you have something like Youtube::update(...) in your code ??

from youtube.

ahmedash95 avatar ahmedash95 commented on July 19, 2024

@arcanedev-maroc Here is my mistake #44 (comment)

from youtube.

joedawson avatar joedawson commented on July 19, 2024

@arcanedev-maroc he's already solved this, he used the $video variable twice here - #44 (comment)

from youtube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.