/** * Returns HTML containing all video details. * @param integer $cid Content ID of the video. * @return string JSON String */ function getVideoHtml($cid) { $v=new video($cid); $tagarray=$v->getTags(); $c=count($tagarray); $tags=""; for($i=0;$i<$c;$i++) $tags.="<li><a href='search.php?tag=".$tagarray[$i]."'>".$tagarray[$i]."</a></li>"; $video= "<span class='videoTitle'>".$v->getTitle()."</span> <!-- Begin VideoJS --> <div class='video-js-box'> <video cid='".$v->getContentId()."' poster='".$v->getPoster()."' class='video-js' controls preload height=325 width=550> <source src='".$v->getCompletePath()."' type='video/ogg; codecs=\"theora, vorbis\"' /> </video> </div> <!-- End VideoJS --> <!-- video bar --> <div class='videoBar'> <img src='pics/vidbar/watch.png' class='VideoBarButton' /><span class='videoBarElement' id='playCount'>Views:".$v->getViewCount()."</span> <span id='likes' defStatus='1' ></span> <img src='pics/vidbar/download.png' title='Download' class='VideoBarButton' style='float:right;' id='downloadButton' /> </div> <!-- /video bar --> <img src='pics/vidbar/tag.png' title='tags' style='margin-left:6px;'/> <ul class='tags'>".$tags."</ul> <div class='VideoDesc'>".$v->getDesc()."</div>"; $v->addViewCount(); return $video; }
/** * Returns JSON string containing all video details. * @param integer $cid Content ID of the video. * @param integer $uid User ID of the user who requests the video. * @return string JSON String */ function getVideoJson($cid, $uid) { $v = new video($cid); $v->fetchSeries(); $json = array("cid" => $v->getContentId(), "title" => $v->getTitle(), "desc" => $v->getDesc(), "tags" => $v->getTags(), "timestamp" => $v->getTimestamp(), "viewcount" => $v->getViewCount(), "status" => $v->getStatus(), "path" => $v->getCompletePath(), "poster" => $v->getPoster(), "likestatus" => user::checkLike($uid, $cid), "sid" => $v->getSeriesId(), "sname" => $v->getSeriesName(), "order" => $v->getOrder(), "uid" => $v->getUserId(), "uname" => user::getFullNameS($v->getUserId())); $v->addViewCount(); return json_encode($json); }