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 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥15 统计大规模图中的完全子图问题
  • ¥15 使用LM2596制作降压电路,一个能运行,一个不能
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错
  • ¥20 @microsoft/fetch-event-source 流式响应问题