so i am working on a project where a video uploading feature should be there,
this is how i uploading a video
//view for video
video uploader
<form action="{{route('videoUploader')}}" role="form" id="postForm" name="postForm" method="POST"
enctype="multipart/form-data">
@csrf
<input type="file" name="files[]" multiple ><br/>
<input type="submit" value="upload">
</form>
and on controller side the code is //controller for video
public function videoUpload(Request $request){
$files=$request->file('files');
$videoArray=[];
if($files){
foreach($files as $video){
$filename= $video->getClientOriginalName();
$extension = $video->getClientOriginalExtension();
$fileNameToStore = $filename. '_'.time().'.'.$extension;
$path = $video->move('storage/videos',$fileNameToStore);
$videoArray[]=$fileNameToStore;
}
}
return view('admin.Post.video',compact('videoArray'));
}
and this is how i am getting and see output on blade
@if (!empty($videoArray))
@foreach ($videoArray as $video)
<iframe src="{{ asset('storage/videos/'.$video) }}"frameborder="0" width="250" height="200"
allowfullscreen></iframe>
@endforeach
@endif
but the issue is, i want these videos to trim first, if video is more than 1 minute longer, it should be trimmed, and get trimmed video to show on the blade, and i don't have any idea how can i achieve this. i could not find any helpful tutorial on web for this, so i came here. please help me and thanks in advance