$db = JFactory::getDbo();
		$uri =JURI::getInstance();
		$url= $uri->root();


$imaga_path=$url.'components/com_naderapp/assets/video_image/';
		
 $query='SELECT * FROM #__naderapp_video WHERE published=1 ORDER BY `id` DESC';
		$db->setQuery($query); 
		$parents=$db->loadObjectList();

$video=array();
		
	if($parents)
	{	
		
		for($i=0;$i<count($parents);$i++)
		{
			$row=$parents[$i];
			
			$videoarray=array();
				
			$videoarray['id']=$parents[$i]->id;
                        $videoarray['title'] = $parents[$i]->video_title;
			$videoarray['imagename']=$imaga_path."thumb_".$parents[$i]->video_image;

			$videoarray['video']=$parents[$i]->youtubelink;
			
			$video[]=$videoarray;
		}
		
		
		
		 $arr = array('success' => '1','video' => $video);
   		 echo json_encode($arr);exit;
		
	}
	else
	{
		
		  $arr = array('success' => '0','video' => 'No Record Found');
 		  echo json_encode($arr);exit;
		
	}