VK.COM embed set start time and hide controls
Asked Answered
O

2

14

How can I embed a video from vk.com and specify the time on which the video should start (eg: the video should start from the middle, or from second 5), and to hide the controls, like on YouTube?

A simple embed looks like:

<iframe src="//vk.com/video_ext.php?oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=2" width="853" height="480" frameborder="0" allowfullscreen></iframe>

To make it autoplay I solved by adding &autoplay=1 at the end of the src url.

I tried to find an API or something else for the embed but I am unable to find it. Thank you!

Oilbird answered 16/8, 2016 at 8:28 Comment(0)
M
5

It seems like vk.com used to support &t=1m14s parameter when it was using Flash video player, but they don't have such functionality since they moved to HTML player.

So the answer is - there is no way to do it.

Michaelamichaele answered 30/8, 2016 at 12:46 Comment(1)
Thank you for your post. I will try using the flash video player, if it is available...Oilbird
M
2

To set a video's current time we use .currentTime . In order to do this first you need the url of the actual video. To do so click into your iframe src then get the video src up to .mp4 which is https://cs634504.vk.me/u162756656/videos/6c35b838ac.480.mp4 .

    var mediaElement =  document.getElementById("video");
	mediaElement.currentTime = 122;    
<video id="video" controls>
	<source src="https://cs634504.vk.me/u162756656/videos/6c35b838ac.480.mp4" type="video/mp4">
</video>
Makalu answered 30/8, 2016 at 15:10 Comment(1)
Thank you! It is helpful, but is it legally to embed a video from a website by using the url of the video, not their embed code with their player (which has, usually, their logo, link to the video etc)?Oilbird

© 2022 - 2024 — McMap. All rights reserved.