|
Ok!
|
|
|
Ok!
|
---|---|---|---|---|
302 | if (strlen($youtube_id) > 11) { // rutube $result = file_get_contents('https://rutube.ru/api/video/' . $youtube_id . '/thumbnail/'); // Will dump a beauty json :3 $preview_url = json_decode($result, true); $preview_url_url = $preview_url['url']; echo '<div class="youtube" itemscope itemtype="http://schema.org/VideoObject" data-src="https://rutube.ru/play/embed/' . $youtube_id . '" id="' . $youtube_id . '" style="background-image: url(//i.ytimg.com/vi/' . $youtube_id . '/0.jpg);"> <meta itemprop="name" content="' . $name . '"/> <meta itemprop="description" content="' . $descr . '"/> <meta itemprop="duration" content="PT' . $t[0] . 'M' . $t[1] . 'S"> <meta itemprop="isFamilyFriendly" content="true"> <meta itemprop="uploadDate" content="' . date("Y-m-d H:i:s", filemtime(__FILE__)) . '"/> <span itemprop="thumbnail" itemscope itemtype="http://schema.org/ImageObject"> <img itemprop="contentUrl" src="' . $preview_url_url . '" style="width:580px;height:324px;" alt="' . $name . '"/> <meta itemprop="thumbnailUrl" content="' . $preview_url_url . '"> <meta itemprop="width" content="580"> <meta itemprop="height" content="324"> </span> <div class="play"><a itemprop="url" href="https://rutube.ru/play/embed/' . $youtube_id . '"></a></div></div>'; } | php, preview | 130 | Функция php для вставки видео Рутуб по кнопке с превью картинкой |
286 | $url = 'https://rutube.ru/api/video/' . $id; $preview_src = 'https://rutube.ru/play/embed/' . $id . '/thumbnail/?redirect=1'; | rutube, preview | 9000 | Ссылка на видео rutube.ru и ссылка на превью |