Download the PHP package menincode/yii2-youtube-api without Composer
On this page you can find all versions of the php package menincode/yii2-youtube-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-youtube-api
Youtube Api for yii2
Youtube api is a yii2 extension to use youtube api as a yii2 component.
this extension access youtube api via oauth, saving the access token and refresh it when expire, so you have to give credentials just once
This extension also contains methods for partners, so you don't have to put your onBehalfContentOwner every single call, and control the youtube partner calls per minute to avoid overflow of limit call per minute
With this extension you can
- upload and update a videos
- upload a thumbnail for a video
- list of videos
- create and update playlists
- get ,add and remove elements for a playlist
- searches
- Put the player
Also can do partener actions like
- get channels
- monetize/unmonetize videos
Installation
The preferred way to install this extension is through composer.
Usage
Add it to your components
add to your components
and are so important, in one you gonna save your accessToken and another let the component take it.
In the example above, the access token was save it in txt, and in te function to take it return the content of that file.
It's important that you has one parameter ( for example) and always save only .
generate your access token
An advantage of this component is that you only have to generate your access token once.
Create an action in any controller
You can call your action as you want, when has a GET parameter called 'code', you must call , this method create and save the access token and redirect to the url passed as parameter.
To get this action you must do it through , you can use it for example in a tag
for example
The access token'll be saved and you can use the component
Example
You can pass in , the parts that you want, if you don't want the default parts. For more information of every method and how do it, read the PhpDOC of component's methods
Partner
if you want to use the extension as a partner you must indicate your in your config
If you don't know your you can get it with method
Player
This extension include a player in widget format