Skip to content

Instantly share code, notes, and snippets.

@sergej-brazdeikis
Created May 20, 2012 02:53
Show Gist options
  • Save sergej-brazdeikis/2736766 to your computer and use it in GitHub Desktop.
Save sergej-brazdeikis/2736766 to your computer and use it in GitHub Desktop.
vk.com video play
<?php
/*
* Returns iframe code to play video
* Note: some videos are unable to embed because of particular video settings
*/
public function play($id1, $id2)
{
// getting hash
$hash = $this->gb->getPregOne('http://vk.com/video'.$id1.'_'.$id2, "/hash2[^0-9a-f]*([0-9a-f]*)/");
$link = 'http://vk.com/video_ext.php?oid='.$id1.'&id='.$id2.'&hash='.$hash.'&hd=1';
return $link;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment