PHP code example of php-junior / dailymotion

1. Go to this page and download the library: Download php-junior/dailymotion library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

php-junior / dailymotion example snippets


composer 

PhpJunior\DailyMotion\DailyMotionProvider::class,
 
php artisan vendor:publish --provider="PhpJunior\DailyMotion\DailyMotionProvider"

/*
|--------------------------------------------------------------------------
| Dailymotion
|--------------------------------------------------------------------------
|
|  Scope :  `read', `write', `delete', `email', `userinfo', `feed',
|           `manage_videos', `manage_comments', `manage_playlists',
|           `manage_tiles', `manage_subscriptions', `manage_friends',
|           `manage_favorites', `manage_likes', `manage_groups', `manage_records',
|           `manage_subtitles', `manage_features', `manage_history', `ifttt', `read_insights',
|           `manage_claim_rules', `delegate_account_management', `manage_analytics', `manage_player',
|           `manage_user_settings', `manage_collections', `manage_app_connections', `manage_applications'
|
|  Whitespace separated
*/

return [
    'client_id'     => 'client_id',
    'client_secret' => 'client_secret',
    'username'      => 'username',
    'password'      => 'password',
    'scope'         => 'manage_videos userinfo manage_playlists manage_user_settings manage_applications'
];


$result = DailyMotion::get( 
    '/videos', [
        'fields' => 'id,title,owner'
    ]);

DailyMotion::file($url)->post('/me/videos',[
    'title'     => 'Dailymotion upload test',
    'tags'      => 'dailymotion,api,sdk,test',
    'channel'   => 'videogames',
    'published' => true
]);