<?php require_once __DIR__ . '/../vendor/autoload.php'; /** * Create video with params */ $attrs = ['url' => 'http://techslides.com/demos/sample-videos/small.mp4', 'description' => 'Description', 'title' => 'Title', 'category_id' => 13, 'is_hidden' => 1]; $video = (new \Rutuber\Video())->setAttributes($attrs); /** * Authorize user */ $account = \Rutuber\Account::authorize($username, $password); /** * account, please upload video * If all is ok return Rutuber id's. Just in case, save all ids. */ $account->uploadVideo($video); /** * We can check status video. If recieved Rutuber ids then status == true */ $status = $video->isUploaded(); /** * Status not true? why? Lets check errors */ $errors = $video->getErrors(); /** * Change publication time */ $account->changeVideoPublicationDatetime($video->getRutuberVideoId(), '2015-01-16 20:36:31'); /** * Want to delete own video?
/** * @param $username * @param $password * @param $secure * @param $pullProfile * @return \Rutuber\Account * @throws \Rutuber\Exception\AccountCredentialsError */ protected function auth($username, $password, $secure, $pullProfile) { return \Rutuber\Account::authorize($username, $password, $secure, $pullProfile); }