donglipi4495 2016-09-22 09:41
浏览 43
已采纳

使用laravel 5.2显示视频

I am working on Laravel 5.2. I have to display a video on my view page.I am able to store the video in my database table but, not able to fetch it and display it.I have the column in my table having the filepath of the videos which i am using to fetch it from the database.

My Controller:

   public function talent(Request $request){
   $user=new Talent(); 
   $this->validate($request, [

     'video'=>'required',
   ]);
   $video=$request->file('video');


   $filename=time().'.'. $video->getClientOriginalExtension();
   $pathVideo = public_path('uploads/video/' . $filename);
   Input::file('video')->move('uploads/video/', $pathVideo);
   $user->file_path=$pathVideo;


   $user->video=$filename;

   $user->user_id=Auth::user()->id;
   $user->save();

    return redirect()->back();

    }

   public function talentpool($id){
   $user=User::findorFail($id);
   $talents=Talent::orderBy('created_at','desc')->get();
   return view('talentpool',['user'=>$user,'talents'=>$talents]);
    }

My View:

   @foreach($talents as $talent)
   <video width="616" src="{{ $talent->file_path }}" controls></video>
   @endforeach
  • 写回答

2条回答 默认 最新

  • donglu6805 2016-10-20 05:45
    关注

    php.ini files contains some limits that might affect this. Try changing these to high enough values:

    upload_max_filesize = 10M
    post_max_size = 10M
    memory_limit = 32M
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测