W
W
Web Lizard2017-04-07 22:14:32
In contact with
Web Lizard, 2017-04-07 22:14:32

How to embed a video from VKontakte on a website?

The database contains data in this form
video-112250475_456239337
. There is also the id of the video itself and the owner_id
Question - how to insert it on the site? Taking into account the fact that the video is also hosted on YouTube?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MaximMRX, 2017-04-07
@Lizard-108

As an option, do an export ready from VK (Share → Export)
Forming an iframe code, as far as I understand, is impossible without an API. Because the hash parameter is generated with a salt for each video record individually. Naturally, with the aim of not making video hosting from VK. Also, so that the video recording embedded on a third-party site is played even if it is closed by privacy
Alternatively, you MUST use the API. https://vk.com/pages?oid=-1&p=video.get
After you receive the response in JSON, you are interested in Parameter:

"player":"http:\/\/vkontakte.ru\/video_ext.php?oid=13245770&id=137352259&hash=47b1a5a52121a243"

Well, now we have already received src. You can also generate an iframe.
Here (an approximate answer) to solve your problem: https://habrahabr.ru/sandbox/57173/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question