Ejemplo n.º 1
0
 public function edit($video_id)
 {
     $objVideos = new Videos();
     $objFile = new Files();
     $video = $objVideos->where('_id', $video_id)->first();
     $video = json_decode($video);
     if (isset($video->images) && $video->images != '') {
         foreach ($video->images as $img) {
             $file = $objFile->where('_id', $img->id)->first();
             $img->title = $file->title;
             $img->url = $file->url;
             $img->name = $file->name;
             $img->folder_id = $file->folder_id;
             $img->mime = $file->mime;
         }
     }
     return view('videos::add')->with('video', $video);
 }
Ejemplo n.º 2
0
 public function update()
 {
     $user = $this->getUser();
     $request = Request::all();
     $objPhotos = new Files();
     $photo = $objPhotos->where('_id', '=', new \MongoId($request['id']))->where('uid', '=', $user['id'])->first();
     $photo->name = $request['name'];
     $photo->title = $request['title'];
     $photo->save();
     return Response::json($photo);
 }
 public function videoDetail($video_id, $pr)
 {
     $relatedVideos = Youtube::getRelatedVideos($video_id);
     $video_info = Youtube::getVideoInfo($video_id);
     $video_des = $video_info->snippet->description;
     $sender = array('video_id' => $video_id, 'video_des' => $video_des, 'relate_videos' => $relatedVideos, 'pr' => $pr);
     if ($pr) {
         $objFile = new Files();
         $objVideos = new Videos();
         $video = $objVideos->where('idVideo', $video_id)->first();
         $video = json_decode($video);
         $images = array();
         if ($video->description != '') {
             $sender['description'] = $video->description;
         }
         if (!empty($video->images)) {
             foreach ($video->images as $k => $img) {
                 $file = $objFile->where('_id', $img->id)->first();
                 $images[] = array('url' => $file->url, 'title' => $file->title, 'minutes' => $img->minutes, 'seconds' => $img->seconds, 'current' => $k, 'extern_url' => $img->extern_url);
             }
             $sender['images'] = $images;
         } else {
             $sender['images'] = array();
         }
     }
     //print_r($sender);die;
     return view('frontend::templates.video_detail', $sender);
 }