ksolutions/videotothumbbyks 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ksolutions/videotothumbbyks

最新稳定版本:v1.0.1

Composer 安装命令:

composer require ksolutions/videotothumbbyks

包简介

A package to create thumbnails from videos and images for Laravel and Core PHP

README 文档

README

videotothumbbyks

This package is created by Khemraj Sharma if you have any Queries then Please contact me at captainjacksparrow295@gmail.com

Step ---1 ---- Install this package

composer require ksolutions/videotothumbbyks

Step ---2 ----

sudo apt update

sudo apt install ffmpeg

Step ---3 ----

In your Controller

use KSolutions\VideoToThumb\VideoToThumb;

public function uploadVideo(Request $request)

{

try {
    if (!$request->hasFile('video')) {
        return response()->json(['status' => 'failed', 'message' => 'No video file uploaded']);
    }
    $file = $request->file('video');
    $time = time();
    $videoPath = $file->storeAs('public/videos', $time.'-video.mp4');
    $videoFullPath = storage_path('app/' . $videoPath);
    $thumbnailPath = storage_path('app/public/thumbnails/'.$time.'-thumbnail.jpg');
    $videoToThumb = new VideoToThumb();
    $result = $videoToThumb->generateVideoThumbnail($videoFullPath, $thumbnailPath, 5);
    if ($result) {
        return response()->json(['status' => 'success', 'message' => 'Thumbnail generated successfully', 'thumbnail' => $thumbnailPath]);
    } else {
        return response()->json(['status' => 'failed', 'message' => 'Thumbnail generation failed']);
    }
} catch (Exception $e) {
    // Catch and display the exception message
    return response()->json(['status' => 'error', 'message' => $e->getMessage()]);
}

}

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固