承接 codebuglab/laravel-srt-parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

codebuglab/laravel-srt-parser

最新稳定版本:v0.0.3-beta

Composer 安装命令:

composer require codebuglab/laravel-srt-parser

包简介

Simple package to parse SubRip or srt file in Laravel

README 文档

README

Simple package to parse SubRip or srt file in Laravel

Laravel Srt Parser

Table of contents

Setup

Installation

To install this package through composer run the following command in the terminal

composer require codebuglab/laravel-srt-parser

Instructions

  • To use Srt Parser you have to include next facade file
use CodeBugLab\SrtParser\Facades\SrtParser;

Convert to Array

  • This is how you can convert srt to array and read every subtitle details.
$path = storage_path('app/Cars (2006).srt'); // file path

$srt = SrtParser::load($path)->toArray();
  • Next is a simple array response you can get from this parser containing subtitle number, start time, stop time, duration of the words appearing in seconds and finally an array of text.
Array
(
    [0] => Array
        (
            [number] => 1
            [startTime] => 00:00:38,365
            [stopTime] => 00:00:41,495
            [duration] => 3.1299998760223
            [text] => Array
                (
                    [0] => OK... Here we go. Focus.
                )

        )

    [1] => Array
        (
            [number] => 2
            [startTime] => 00:00:41,575
            [stopTime] => 00:00:44,935
            [duration] => 3.3599998950958
            [text] => Array
                (
                    [0] => Speed. I am speed.
                )

        )
    .
    .   
    .
)

License

This package is a free software distributed under the terms of the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固