Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call_user_func_array() expects parameter 1 to be a valid callback, class 'Google\Client' does not have a method 'getVideoInfo' #170

Closed
erxsto opened this issue Jul 18, 2021 · 3 comments

Comments

@erxsto
Copy link

erxsto commented Jul 18, 2021

Al momento de dirigirme a mi vista, me salta este error

@alaouy
Copy link
Owner

alaouy commented Jul 19, 2021

@erxsto Can you provide more details on how to reproduce the error?

@erxsto
Copy link
Author

erxsto commented Aug 12, 2021

In my project, I installed Alaouy & Dawson, one to upload video and the other to view video details.
At the moment of uploading the video, it does not mark error. Then when I want to see the details, I get the error I mentioned. I add you how is my function:
`<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Dawson\Youtube\Facades\Youtube as YoutubeUpload;
use Alaouy\Youtube\Facades\Youtube;

class VideoController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
/
public function index()
{
$videos = Youtube::getVideoInfo('YbIkHQVpDJ8');
return view('content.videoindex', compact('videos'));
}
/
*
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('content/video');
}

/**
 * Store a newly created resource in storage.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
public function store(Request $request)
{
    {
        $data = request()->validate([
            'title' => 'required|max:255',
            'description' => 'required',
            'video' => 'mimetypes:video/avi,video/mpeg,video/mp4'
        ]);
        $video = YoutubeUpload::upload($request->file('video')->getPathName(), [
            'title'       => $request->input('title'),
            'description' => $request->input('description')
        ]);
 
        return "Video uploaded successfully. Video ID is ". $video->getVideoId();
    }
}

/**
 * Display the specified resource.
 *
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function show($id)
{
    //
}

/**
 * Show the form for editing the specified resource.
 *
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function edit($id)
{
    //
}

/**
 * Update the specified resource in storage.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function update(Request $request, $id)
{
    //
}

/**
 * Remove the specified resource from storage.
 *
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function destroy($video)
{
    $video = YoutubeUpload::delete($video->getVideoId());
    return redirect('videoindex');
}

}
`

@alaouy
Copy link
Owner

alaouy commented Nov 14, 2021

@erxsto Did you resolve your issue?

@erxsto erxsto closed this as completed Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants